当前位置: 首页>>代码示例>>PHP>>正文


PHP Router::middlewareGroup方法代码示例

本文整理汇总了PHP中Illuminate\Routing\Router::middlewareGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::middlewareGroup方法的具体用法?PHP Router::middlewareGroup怎么用?PHP Router::middlewareGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Routing\Router的用法示例。


在下文中一共展示了Router::middlewareGroup方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerMiddleware

 /**
  * 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']);
 }
开发者ID:laravelflare,项目名称:flare,代码行数:17,代码来源:RouteServiceProvider.php

示例2: boot

 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);
     });
 }
开发者ID:KodiComponents,项目名称:module-api,代码行数:7,代码来源:ModuleServiceProvider.php

示例3: boot

 /**
  * 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);
 }
开发者ID:Golars,项目名称:Naissance_Laravel,代码行数:15,代码来源:RouteServiceProvider.php

示例4: __construct

 /**
  * 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);
     }
 }
开发者ID:saj696,项目名称:pipe,代码行数:18,代码来源:Kernel.php

示例5: registerCmsApiGroupMiddleware

 /**
  * 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;
 }
开发者ID:czim,项目名称:laravel-cms-core,代码行数:17,代码来源:MiddlewareServiceProvider.php

示例6: boot

 /**
  * @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);
 }
开发者ID:donny5300,项目名称:modulair-router,代码行数:16,代码来源:ServiceProvider.php

示例7: routes

 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', '.*');
 }
开发者ID:deadem,项目名称:djem,代码行数:18,代码来源:DJEMServiceProvider.php

示例8: middlewareGroup

 /**
  * 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);
 }
开发者ID:andybolano,项目名称:viaja_seguro,代码行数:12,代码来源:_ide_helper.php

示例9: boot

 /**
  * 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')]);
 }
开发者ID:kaankilic,项目名称:instapack,代码行数:11,代码来源:InstaPackServiceProvider.php


注:本文中的Illuminate\Routing\Router::middlewareGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。