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