Modify the response and inject the debugbar (or data in headers)
public modifyResponse ( |
||
$request | ||
$response | ||
return |
/** * Handle an incoming request. * * @param Request $request * @param Closure $next * @return mixed */ public function handle($request, Closure $next) { try { /** @var \Illuminate\Http\Response $response */ $response = $next($request); } catch (Exception $e) { $response = $this->handleException($request, $e); } // Modify the response to add the Debugbar $this->debugbar->modifyResponse($request, $response); return $response; }
/** * Modify the response and inject the debugbar (or data in headers) * * @param \Symfony\Component\HttpFoundation\Request $request * @param \Symfony\Component\HttpFoundation\Response $response * @return \Symfony\Component\HttpFoundation\Response * @static */ public static function modifyResponse($request, $response) { return \Barryvdh\Debugbar\LaravelDebugbar::modifyResponse($request, $response); }