skip to Main Content

I published Laravel’s error pages and customized them. I can test a 404 error, for example, but if I throw an Exception in my controller to test the 500 error page, the debug page of Laravel is displayed instead of my custom 500 error page. How can I test the 500 error page my users will actually see?

2

Answers


  1. Chosen as BEST ANSWER

    Instead of throwing an Exception in your controller, just call abort(500). This will display your custom 500 page.


  2. You can set APP_DEBUG=false in the .env file and when the program encounters an error, it will display the 500 page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search