F
Filamentβ€’3mo ago
Bruno

Adding a button to the footer of the form

I'm Brazilian and I have a problem. I would like to add a button to the create side of the form, this button should open a modal (Custom modal with livewire). How do I do this? Figma example:
No description
2 Replies
LeandroFerreira
LeandroFerreiraβ€’3mo ago
in the create page
public function getFormActions(): array
{
return [
...parent::getFormActions(),
Action::make('customAction')
->action(function () {
//call your modal
}),
];
}
public function getFormActions(): array
{
return [
...parent::getFormActions(),
Action::make('customAction')
->action(function () {
//call your modal
}),
];
}
if you are using https://filamentphp.com/docs/3.x/support/blade-components/modal try
`$this->dispatch('open-modal', id: 'modalId');
`$this->dispatch('open-modal', id: 'modalId');
or
Action::make('customAction')
->dispatch('open-modal', ['id' => 'modalId'])
Action::make('customAction')
->dispatch('open-modal', ['id' => 'modalId'])
Bruno
BrunoOPβ€’3mo ago
Muito obrigado! 😁
Want results from more Discord servers?
Add your server