Why aren’t my custom error pages being called?

Asked

Viewed 381 times

4

My custom error page is not being called.

  • OS: Linux Ubuntu
  • PHP 7 / Laravel 5.5
  • I already created the folder "Resources/errors" and in it the file "404.blade.php"
  • I already gave permission in the OS for the folder
  • I already used the commands "php Artisan cache:clear" and "php Artisan view:clear".
  • I switched in the file . env the option "debug" to false.

Anyway, these are the actions I took.

1 answer

4


I think that at the beginning the error is in the path to the errors folder, this must be in resources/views/errors.

Test example:
- Creates file 404.blade.php inside the folder I mentioned above
- Open a url not defined in app/HTTP/routes.php or routes/web.php (in newer versions of Laravel) and confirms whether to go to this new pag 404.blade.php

From there you can customize it however you want.

  • 2

    Miguel was exactly that. I read the documentation and did not pay attention to this detail. Really the file should be in "Resources/views/errors". Thank you very much!

  • You’re welcome @Alexandrosantos

Browser other questions tagged

You are not signed in. Login or sign up in order to post.