Ive tried adding the below to app/start/global.php which is not working:
App::error(function(Exception $exception, $code) {
Log::error($exception);
$message = $exception->getMessage();
// switch statements provided in case you need to add
// additional logic for specific error code.
switch ($code) {
case 401:
return Response::json(array('code' => 401, 'message' => '$message'), 401);
}
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community