notification actions not work

Notification::make()
->title(''.$getData->car_number.' Qara siyahıdadır')
->body(' Əlavə edilmə tarixi '.$getData->created_at.', Səbəb: '.$getData->reason.' ')
->persistent()
->danger()
->actions([
Action::make('sendToPos')
->label('POS-a Göndər') ->requiresConfirmation()
->action(function (array $arguments) {
dd('Test action called', $arguments);
}),
Notification::make()
->title(''.$getData->car_number.' Qara siyahıdadır')
->body(' Əlavə edilmə tarixi '.$getData->created_at.', Səbəb: '.$getData->reason.' ')
->persistent()
->danger()
->actions([
Action::make('sendToPos')
->label('POS-a Göndər') ->requiresConfirmation()
->action(function (array $arguments) {
dd('Test action called', $arguments);
}),
No description
4 Replies
Dennis Koch
Dennis Koch2w ago
You can't use the full actions. They only allow simplified ones and you need to dispatch an Event to execute more logic. Check the docs: https://filamentphp.com/docs/4.x/notifications/overview#adding-actions-to-notifications
Code with RSL
Code with RSLOP2w ago
@Dennis Koch I need to call another action as a modal window, how do I do this with dispatch?
Dennis Koch
Dennis Koch2w ago
You can use $this->mountAction('action-name') inside the even listener

Did you find this page helpful?