How to prevent showing Success notification on the Edit page?
I am using a custom button with a custom action on the Edit page.
And when pressed, it shows 2 notifications instead of just 1.
The first one is the classic Saved successfullly success message that is part of the save buttons.
The second one is the custom message of mine I put on the button.
Here is the custom-button's code I am using:
The problem is that not only the "It's pending" notification is shown, but also the "Saved successfully" notification toast as well.
How to disable that saved successfully message and show only the my custom notification message?
Solution:Jump to solution
```php
->action(function () {
$this->record->update([
'status' => 'pending',
]);...
7 Replies
I have tried this:
But I am getting an error.
Also I have tried this:
But it also didn't work. No errors shown, but still two toasts are being shown and not just 1.
Can you post all your data, where did you register, how did you register etc.. I'll try to reproduce
I have found this documentation:
But I don't know how to mke it work when I have multiple custom button on the edit page and not onlye the default ones.
I guess I need to "remove" somehow the Notification for the save() method - I guess $this->save() is triggering it.
Or maybe there is another method than save() for manually saving stuff to the dB?
What if I just tried DB::table().... something?
But it would be super cool if I could do it using Filament methods and stuff
Any idea how to make the default Save-notification not to show up after ->save() ?
Solution
Yes, it works! Thanks. Only 1 message, the custom one I want, is showing now.