© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
20 replies
yangsystem

Relationship table on modal? or NEW action on table action page?

I managed to find out that if I create a Resource with -- generate --simple and add a RelationManager to it I will not see the Relation div.
After some struggling/searching/reading posts/searching tutorials... I recreated the Resource with --generate and registered the relation manager to it and I see the table with all functions. If I comment the
 'edit' => Pages\EditAgenti::route('/{record}/edit'),
 'edit' => Pages\EditAgenti::route('/{record}/edit'),
the edit will move to a modal and I do not see the table anymore.

I need an option to add the RelationManager panel on the modal, or even better I want a custom action button on the view page that will open the create form and save to the relation's Model.
somethink like:
Action::make("add-new-to-relation's-model")
Action::make("add-new-to-relation's-model")

that will open a modal where I have what I configure in the relation's form.
Solution
Action::make('adauga')
                    ->label('Add container')
                    ->icon('heroicon-o-folder-plus')
                    ->form([
                        Forms\Components\TextInput::make('contracte_id')
                            ->default('1'),
                        Forms\Components\TextInput::make('container_tip')
                            ->required()
                            ->maxLength(255),
                          ])
                      ->action(function (array $data, Containere $container): void {
                          $container->contracte_id = $data['contracte_id'];
                          $container->container_tip = $data['container_tip'];
                          $container->save();
                      }),
Action::make('adauga')
                    ->label('Add container')
                    ->icon('heroicon-o-folder-plus')
                    ->form([
                        Forms\Components\TextInput::make('contracte_id')
                            ->default('1'),
                        Forms\Components\TextInput::make('container_tip')
                            ->required()
                            ->maxLength(255),
                          ])
                      ->action(function (array $data, Containere $container): void {
                          $container->contracte_id = $data['contracte_id'];
                          $container->container_tip = $data['container_tip'];
                          $container->save();
                      }),
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

table action modal
FilamentFFilament / ❓┊help
3y ago
Modal action or table inside form
FilamentFFilament / ❓┊help
2y ago
Trigger table filters modal from another action on the page
FilamentFFilament / ❓┊help
3y ago
Page Action Modal Issue
FilamentFFilament / ❓┊help
14mo ago