3

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?

1 Answer 1

1

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)

Sign up to request clarification or add additional context in comments.

1 Comment

hello Jesse, thanks for your reply mate but this is not what I'm looking for. I probably haven't phrased my question very well but what you are suggesting is what I don't want to use. You see I work with a single installation of laravel and have each of my projects organized in a package folder and I want everything to be in there. Thanks again for your reply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.