What error are you getting in the console ?
Jan 17, 2025
4
Level 3
Filament custom exeptions Notifications
I want to catch my exceptions that interrupt the code, but at the same time do not show the client of the site, an incomprehensible window with an error. And in the notification it shows the error text.
But I can't get the one that when I click on the submit form button, the button freezes and an error appears in the console.
But if I reload the page, the notification appears.
How can I finish this correctly?
->withExceptions(function (Exceptions $exceptions) {
$exceptions->render(function (\App\Exceptions\FilamentNotificationException $e, $request) {
\Filament\Notifications\Notification::make()
->title('Ошибка')
->body($e->getMessage())
->danger()
->send();
return response()->json(['success' => true, 'message' => $e->getMessage()], 200);
});
})
bootstrap/app.php
Please or to participate in this conversation.