How to show custom 404 message on {record} route for every FilamentPHP v3 Resource?

In FilamentPHP v3, when a user visits a route like /posts/{record} and the record doesn’t exist, it throws the default 404 error page. Is there a way to override this behavior to show a custom 404 message or Blade view — ideally inside the Filament layout (replacing the main content)? I’d like this to apply globally to all resources, not just one by one. Is there a clean, reusable way to extend ViewRecord or hook into the record resolution logic? Any advice or examples would be super helpful. Thanks in advance! 🙏
No description
5 Replies
manojhl
manojhlOP2w ago
Thanks, but I'm using Filamentphp Panel. I can't find a way to set up a Fallback route for routes generated by FIlamentphp
Bruno Pereira
Bruno Pereira2w ago
Filament renders the laravel default pages, you can publish them by running
php artisan vendor:publish --tag=laravel-errors
php artisan vendor:publish --tag=laravel-errors
And then customize them as you like
Bruno Pereira
Bruno Pereira2w ago
Error Handling - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
manojhl
manojhlOP2w ago
Like how empty post is, I wanted to added a “no post found” for 404 with some custom text depending on the resource
No description

Did you find this page helpful?