FilamentF
Filament2y ago
Toni

Sending notification after action

Hi,
I have this action:
Actions\Action::make('Publish')
                ->label(__('mailtemplate.labels.publish'))
                ->action(fn () => MailHelper::publishMailTemplate($this->record))
                ->successNotification(
                    Notification::make('published')
                        ->title(__('mailtemplate.notifications.published'))
                        ->success()
                )
                ->visible(fn () => !$this->record->is_published),

After a successful performance I would the notification, but nothing happens.
What do I miss?

Thanky you
Solution
Just add it at the end of action(). The method you use if for default actions. As soon as you use action() it’s not called
Was this page helpful?