expectsJson()) { return $this->exception($exception); } if (config('app.debug')) { Log::error($exception->getTraceAsString()); return parent::render($request, $exception); } return new Response(500, [], $exception->getMessage()); } }