© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
Asmit

Action failed notification.

I have to delete the record from the table using table delete actions, Sometimes there is an issue with delete operation and throw the exception, I want to show that exception message on failed notification. How can I do that in filament.
Solution
@Karthick K Thanks for the idea. Did you say like this
Service Provider:
public function register(): void
    {
        $this->app->bind(DeleteAction::class, TableDeleteAction::class);
    }
public function register(): void
    {
        $this->app->bind(DeleteAction::class, TableDeleteAction::class);
    }

TableDeleteAction:
class TableDeleteAction extends DeleteAction
{
    protected function setUp(): void
    {
        parent::setUp();

        $this->action(function ($record) {
            try {
                $record->delete();
                Notification::make()
                    ->success()
                    ->title('Record deleted successfully!')
                    ->send();
            } catch (ManuallyFailedException $e) {
                Notification::make()
                    ->danger()
                    ->title($e->getMessage())
                    ->duration(5000)
                    ->send();
            }
        });
    }
class TableDeleteAction extends DeleteAction
{
    protected function setUp(): void
    {
        parent::setUp();

        $this->action(function ($record) {
            try {
                $record->delete();
                Notification::make()
                    ->success()
                    ->title('Record deleted successfully!')
                    ->send();
            } catch (ManuallyFailedException $e) {
                Notification::make()
                    ->danger()
                    ->title($e->getMessage())
                    ->duration(5000)
                    ->send();
            }
        });
    }
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Notification Action - V4
FilamentFFilament / ❓┊help
8mo ago
Embed Notification Action
FilamentFFilament / ❓┊help
2y ago
Notification custom action
FilamentFFilament / ❓┊help
3y ago
Hide Notification Sidebar After Notification Action
FilamentFFilament / ❓┊help
3y ago