Laravel: Change Default Error Pages

Written by SarahS

7th November 2019

If you want to replace the default Laravel error pages (e.g. 401, 419, 500) then it’s pretty straightforward. All you need to do is create a new folder in the ‘views’ directory and call it ‘errors’. Then create your new error pages and use the following naming conventions: code.blade.php e.g. 500.blade.php. That’s it, these new pages will then override the default ones.

If you’d like to replace them with something pretty fancy and pre-built then try the package from Laravel Collective. Check out the designs here and the code is in a GitHub repository here.

This is one of my Laravel posts.  I’m still learning Laravel so the posts are usually pretty basic and are more aimed at keeping track of things that I find useful so that I can come back to them again at a later date.  I hope you find them useful too.  If not, or if you think they are wrong then please leave a comment below.  Thank you.

Faster Laravel Hosting

If this post helped you or if you have any questions please leave me a comment below:


You May Also Like…

Setting up SQLite for Laravel

Setting up SQLite for Laravel

Sometimes you may decide you want to use SQLite for your Laravel app instead of a full blown MySQL database. In that...