/** * Middleware invokable class * * @param \Psr\Http\Message\ServerRequestInterface $request PSR7 request * @param \Psr\Http\Message\ResponseInterface $response PSR7 response * @param callable $next Next middleware * * @return \Psr\Http\Message\ResponseInterface */ public function __invoke(Request $request, Response $response, $next) { $response = $next($request, $response); RedBeanBarPanel::boot($this->panel); return $response; }
/** * Helper method to collect the queries and show the panel. * @param RedBeanBarPanel $panel [description] */ public static function boot(RedBeanBarPanel $panel) { $panel->collect(); Debugger::getBar()->addPanel($panel); }