芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/www/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php
container = $container; $this->debugbar = $debugbar; $this->except = config('debugbar.except') ?: []; } /** * Handle an incoming request. * * @param Request $request * @param Closure $next * @return mixed */ public function handle($request, Closure $next) { if (!$this->debugbar->isEnabled() || $this->inExceptArray($request)) { return $next($request); } $this->debugbar->boot(); try { /** @var \Illuminate\Http\Response $response */ $response = $next($request); } catch (Throwable $e) { $response = $this->handleException($request, $e); } // Modify the response to add the Debugbar $this->debugbar->modifyResponse($request, $response); return $response; } /** * Handle the given exception. * * (Copy from Illuminate\Routing\Pipeline by Taylor Otwell) * * @param $passable * @param Throwable $e * @return mixed * @throws Exception */ protected function handleException($passable, $e) { if (! $this->container->bound(ExceptionHandler::class) || ! $passable instanceof Request) { throw $e; } $handler = $this->container->make(ExceptionHandler::class); $handler->report($e); return $handler->render($passable, $e); } /** * Determine if the request has a URI that should be ignored. * * @param \Illuminate\Http\Request $request * @return bool */ protected function inExceptArray($request) { foreach ($this->except as $except) { if ($except !== '/') { $except = trim($except, '/'); } if ($request->is($except)) { return true; } } return false; } }