You should be able to.
Make sure your error views (404.blade.php, or 500.blade.php) were not modified. 404.blade.php should look like this for instance:
https://github.com/Laravel-Backpack/Base/blob/master/src/resources/error_views/404.blade.php
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everybody,
So I'm just wondering why, with out-of-the-box laravel 5.7, abort(403, 'My custom text') sets my custom text BUT if I do the same for 404 or 500 it doesn't set my custom text?
This is unusual.
Kind regards, Dev
@DEVMASTER - If you want to costumize this views, you need to create the blade yourself with the name of the error code inside resources/views/errrors folder(resources/views/errors/404.blade.php). Then when the error code is thrown, this blade you created will be rendered.
Docs: https://laravel.com/docs/5.8/errors#custom-http-error-pages
Please or to participate in this conversation.