I want to disable Laravel's error screen that shows the errors/exceptions with debugging information and functions trace. Mostly because I'm using Laravel as mobile API backend and those responses are harder to read on a mobile device.
Please notice that I want the errors, but not the fancy error page.
Any suggestions?
Go to Laravel project -> app folder-> config folder -> app.php set
'debug' => false,
This will show a simple error page like Ops! Something went wrong.
Edit:
Laravel App facade provides a way to way catch the exceptions using error method as mentioned in the Laravel docs
App::error(function(Exception $exception)
{
// handle your exception
});
You can place App::error method in the filters.php
and Laravel is using Symfony to display those pages if you want to further go down. I have not really tried to change this thing, maybe someone will come up with a better answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With