middlewareGroup() public method

Register a group of middleware.
public middlewareGroup ( string $name, array $middleware )
$name string
$middleware array
 /**
  * Register all the Flare Provided Middleware and Middleware Groups.
  *
  * We define flarebase rather than extend an existing middleware stack
  * since it is possible that a user has amended the default middleware 
  * of their application in a way that could break Flare.
  * 
  * @param Router $router
  */
 protected function registerMiddleware(Router $router)
 {
     $router->middleware('flareauthenticate', \LaravelFlare\Flare\Http\Middleware\FlareAuthenticate::class);
     $router->middleware('checkmodelfound', \LaravelFlare\Flare\Http\Middleware\CheckModelFound::class);
     $router->middleware('checkpermissions', \LaravelFlare\Flare\Http\Middleware\CheckPermissions::class);
     $router->middlewareGroup('flarebase', [\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\EncryptCookies::class]);
     $router->middlewareGroup('flare', ['web', 'flarebase', 'flareauthenticate', 'checkpermissions']);
 }
 public function boot(Router $router)
 {
     $router->middlewareGroup('api', [\KodiCMS\API\Http\Middleware\VerifyApiToken::class]);
     Auth::viaRequest('token', function ($request) {
         return app(TokenGuard::class)->user($request);
     });
 }
 /**
  * Define your module's route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 public function boot(Router $router)
 {
     $this->initAssets();
     $router->middleware('authenticate', \App\Modules\VergoBase\Http\Middleware\Authenticate::class);
     $router->middleware('AdminAuth', \App\Modules\VergoBase\Http\Middleware\AdminAuth::class);
     $router->middleware('AdminAuthenticate', \App\Modules\VergoBase\Http\Middleware\AdminAuthenticate::class);
     $router->middlewareGroup('webAdmin', [\App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class]);
     parent::boot($router);
 }
Example #4
0
 /**
  * Create a new HTTP kernel instance.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 public function __construct(Application $app, Router $router)
 {
     $this->app = $app;
     $this->router = $router;
     foreach ($this->middlewareGroups as $key => $middleware) {
         $router->middlewareGroup($key, $middleware);
     }
     foreach ($this->routeMiddleware as $key => $middleware) {
         $router->middleware($key, $middleware);
     }
 }
 /**
  * Registers global middleware for the CMS API.
  *
  * @return $this
  */
 protected function registerCmsApiGroupMiddleware()
 {
     $this->router->middlewareGroup($this->getConfiguredApiGroupName(), []);
     foreach ($this->getGlobalApiMiddleware() as $middleware) {
         // Don't add if the middleware is already globally enabled in the kernel
         if ($this->kernel->hasMiddleware($middleware)) {
             continue;
         }
         $this->router->pushMiddlewareToGroup($this->getConfiguredApiGroupName(), $middleware);
     }
     return $this;
 }
 /**
  * @param IlluminateRouter $router
  */
 public function boot(IlluminateRouter $router)
 {
     $this->config = config('modulair-router');
     $assetsPath = __DIR__ . '/../assets';
     $migration = __DIR__ . '/../migrations';
     $configPath = __DIR__ . '/../config/modulair-router.php';
     $this->publishes([$configPath => $this->getConfigPath()], 'config');
     $this->publishes([$assetsPath => $this->getAssetsPath()], 'assets');
     $this->publishes([$migration => $this->getMigrationsPath()], 'migrations');
     $this->loadViewsFrom(__DIR__ . '/Resources/Views/', 'd5300.router');
     $router->middlewareGroup('CheckMissingRoutes', [CheckMissingRoute::class]);
     $router->middleware('routeDevelopmentMode', DevelopmentMode::class);
 }
Example #7
0
 private function routes(Router $router)
 {
     $router->middleware('djem.auth', \DJEM\Http\Middleware\Authenticate::class);
     $router->middlewareGroup('djem.web', [\Illuminate\Cookie\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \DJEM\Http\Middleware\VerifyCsrfToken::class]);
     Route::group(['middleware' => ['djem.web', 'djem.auth'], 'namespace' => '\\DJEM\\Http\\Controllers'], function () {
         Route::any('djem/api', 'Api@getState');
         Route::any('djem/api/tree', 'Api\\Main@tree');
         Route::any('djem/api/grid', 'Api\\Main@grid');
         Route::any('djem/api/content/delete', 'Api\\Content@delete');
         Route::any('djem/api/content/load', 'Api\\Content@loadRelation');
         Route::get('djem/api/content', 'Api\\Content@get');
         Route::post('djem/api/content', 'Api\\Content@set');
         Route::get('djem/api/files', 'Api\\Files@get');
         Route::post('djem/api/files/upload', 'Api\\Files@upload');
         Route::post('djem/api/files', 'Api\\Files@set');
     });
     Route::get('djem/{file?}', '\\DJEM\\Http\\Controllers\\StaticFiles@get')->where('file', '.*');
 }
Example #8
0
 /**
  * Register a group of middleware.
  *
  * @param string $name
  * @param array $middleware
  * @return $this 
  * @static 
  */
 public static function middlewareGroup($name, $middleware)
 {
     return \Illuminate\Routing\Router::middlewareGroup($name, $middleware);
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot(\Illuminate\Routing\Router $router)
 {
     $router->middleware('instaPack', 'Kaankilic\\InstaPack\\Http\\Middleware\\InstaMiddleware');
     $router->middlewareGroup('web', ['Kaankilic\\InstaPack\\Http\\Middleware\\SetupHandler']);
     $this->publishes([__DIR__ . '/../../config/instapack.php' => base_path('config/instapack.php')]);
 }