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? bootstrap/app.php
->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);
});
})
->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);
});
})
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?