FilamentF
Filamentβ€’17mo ago
d3v1anX

Open modal after page load

Hey guys,

I have a table which has only modal (slideOver) to edit / create entries.
Now I'd like to create a button from another resource to the target resource and open directly after loading the "create" modal.

My code until now:

protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('invite_user')
                ->label(__('Teammitglied einladen'))
                ->button()
                ->icon('heroicon-o-plus-circle')
                ->url(InvitationResource::getUrl('index', ['create' => true]))
            ,
        ];
    }


if I try to "create" instead of index it shows an error, because the route does not exists. -> its just a modal πŸ™‚

Has anyone an idea? Maybe I can react on the parameter and open the modal somehow after loading the table?
Solution
got it πŸ™‚
instead of

->url(InvitationResource::getUrl('index', ['create' => true]))

just
->url(InvitationResource::getUrl('index', ['action' => 'create']))
Was this page helpful?