Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
return response()->make(
$whoops->handleException($e),
method_exists($e, 'getStatusCode') ? $e->getStatusCode() : 500,
method_exists($e, 'getHeaders') ? $e->getHeaders() : []
);
}
return parent::convertExceptionToResponse($e);
}

👍

good. thanks!

uchsarath commented Oct 25, 2016 edited

This works really well on 5.3. 1+

pilot911 commented Dec 3, 2016

Thanks! Nice work with Laravel core AuthenticationException

thanks, i hate the default error on laravel 5.3 its super confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment