I want to handle 500 Internal Server Error as a JSON response in my postman, please help me.
I have this kind of code in Exception/Handler.php and I don't have any idea how to handle a 500 Internal Server Error that returns a JSON response in POSTMAN.
$this->renderable(function (HttpException $e, $request) {
if($request->is('api/*')){
return response()->json(['message'=> $e->getMessage(),'code' => $e->getStatusCode()]);
}});