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);
    }

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();
            }
        });
    }
Was this page helpful?