*/ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. * * @return void */ public function register() { $this->reportable(function (Throwable $exception) { // }); $this->renderable(function (NotFoundHttpException $e, $request) { if ($request->is('api/*')) { return response()->json([ 'status' => -1, ], 404); } }); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $exception * @return \Illuminate\Http\Response */ public function render($request, Throwable $exception) { if ($exception instanceof NotFoundHttpException) { } elseif ($exception instanceof AuthenticationException) { } else { inspector()->reportException($exception); } //default laravel response return parent::render($request, $exception); } }