13 Replies
Filament
Sending notifications - Notifications - Filament
Elegant TALL stack notifications for Laravel artisans.
I read the docs
In the pic which I sent, The approve button dose nothing
I want to add an action to the button
Share some code 🤷🏼♂️ We can't read screenshots
what are you wanting the Action to do? I don't see any ->action() within there that is going to run a function.
You just added an empty action, so how to you expect it to do anything?
When I add the action function to the button, An error accrue
Method Filament\Notifications\Actions\Action::action does not exist
Ah right. You can't execute stuff from Notification actions directly. You can
emit
or redirect with url
Ok
After emitting an event
can I listen to it using a Laravel listener class
Or I am missing somthing
Thank you so much
I want to send the event to a Livewire listener using emitTo but this error accrue
Method Filament\Notifications\Actions\Action::emitTo does not exist
Are you on a recent version?
Follow this steps:
1.
php artisan make:livewire GlobalEventsListener
2. open App\Providers\AppServiceProvider
and add this code:
3. open App\Http\Livewire\GlobalEventsListener
and add this code:
4. in your notification's action, emit the event like this ->emit('myEventName', ['my_eloquent_model_id' => $myId])
5. Profit.