larave except in json handler code example Example: laravel response json status 500 return response()->json(['message' => 'error message'], 500);