public function pushMiddlewareToGroup($group, $middleware) { if (isset($this->middlewareGroups[$group]) && !in_array($middleware, $this->middlewareGroups[$group])) { $this->middlewareGroups[$group][] = $middleware; } return $this; }
/** * Perform post-registration booting of services. * * @return void */ public function boot(Router $router) { // load package routes if (!$this->app->routesAreCached()) { require __DIR__ . '/../../routes.php'; } // make config file available if needed $this->publishes([__DIR__ . '/../../config/liveorletdie.php' => config_path('liveorletdie.php')]); // register package middleware $router->pushMiddlewareToGroup('web', \PeterColes\LiveOrLetDie\Middleware\SessionTimeout::class); }