Support the ongoing development of Laravel.io →
Authentication Requests
Last updated 2 years ago.
0

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);
	}
});
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Wancieho wancieho Joined 17 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.