F
Filament2mo 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 Koch2mo 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
Toni2mo ago
Thank to all, it works!
Want results from more Discord servers?
Add your server
More Posts
Trying to mount an stripe element in the last step of wizardTrying to mount an stripe element in the last step of wizard but as stripe element mount once, when Multiple filters on a line chartHow can I add multiple kinds of filters to a line chart? So like a month filter and a category filteUse ENUMS in controllerI have a controller that print a pdf now i need to use an ENUM, but i always get errors My code is Not able to select newly created options using CreateOptionsForm until refreshHey y'all, I've created some monstrosity. I'm sure there's a better way of doing this, and if you caShow Indicator on Custom Filter doesn't workWhat I am trying to do: I am trying to display my custom date filter indicator. My filter contain 2 TableWidget::$table must not be accessed before initialization only on mobileThe `table` method of my `TableWidget` is only called when changing a select page filter on desktop Render Hook for footer will not stay in the bottom...Render Hook for footer will not stay in the bottom when the page has short content. Any idea to fix Hide certain parent form fields on relationship manager.Hi - I'm still fairly new to Filament and this may be obvious and I'm just not getting it. I have How to change the icon of createOptionForm icon on select field ?User Text instead of icon like Add new candidate rather than + iconUnable to find component: [app.filament.pages.auth.custom-login]Livewire\Exceptions\ComponentNotFoundException Unable to find component: [app.filament.pages.auth.cu