F
Filament6mo 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),
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
Jump to solution
3 Replies
Expecto Patronum
Add ->send() after visible
Solution
Dennis Koch
Dennis Koch6mo ago
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
Toni
ToniOP6mo ago
Thank to all, it works!
Want results from more Discord servers?
Add your server