respondUnauthorized($e->getMessage()); } /** * Respond with an Unauthorized message. * * @param string $errorMessage * @return \Illuminate\Http\Response */ protected function respondUnauthorized($errorMessage = null) { $data = []; if ($errorMessage) { $data = ['errors' => $errorMessage]; } return response()->json([ 'message' => trans('app.error_unauthorized'), ] + $data, 400); } }