In the spirit of keeping a developer's hands as much as possible out of the core installation of laravel, I am trying to find a way to use custom error pages without messing with the core resources folder's blade files, but use the ones provided from the package relevant folder. So is there a way to include error page templates in the ServiceProvider like with the $this->loadViewsFrom
?
in the resources/views
folder you'll find a folder called errors
. In here you can create custom error pages.
For example: 404.blade.php
<html>
<head><title>Page not found :o</title></head>
<body>
<h1>Sorry, we can't find what you're looking for.</h1>
<a href="https://example.com">Take me back to the main site.</a>
</body>
</html>
This page will now show automagically when your application throws a 404. (you can do this with all http response codes)