當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。