Whoops Error Message |
- change directory into your laravel project and type :
composer require filp/whoops
- Copy this code in your App\Exceptions\Handler.php
Whoops Error Message |
/** | |
* 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); | |
} |
Tidak ada komentar:
Posting Komentar