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! 🙏
5 Replies
Easy one maybe (https://laravel.com/docs/12.x/errors#fallback-http-error-pages)
Or https://laravel.com/docs/12.x/routing#fallback-routes handle logic inside the fallback
Thanks, but I'm using Filamentphp Panel. I can't find a way to set up a Fallback route for routes generated by FIlamentphp
Filament renders the laravel default pages, you can publish them by running
And then customize them as you like
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.
Like how empty post is, I wanted to added a “no post found” for 404 with some custom text depending on the resource
