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


PHP Route::group方法代码示例

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


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

示例1: mapApiRoutes

 /**
  * Define the "api" routes for the application.
  *
  * These routes are typically stateless.
  *
  * @return void
  */
 protected function mapApiRoutes()
 {
     Route::group(['middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => 'api'], function () {
         /** @noinspection PhpIncludeInspection */
         require base_path('routes/api.php');
     });
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:14,代码来源:RouteServiceProvider.php

示例2: mapAuthRoutes

 protected function mapAuthRoutes()
 {
     Route::group(['middleware' => 'web', 'namespace' => $this->namespace], function ($router) {
         Route::auth();
         Route::get('/logout', 'Auth\\LoginController@logout');
     });
 }
开发者ID:abalozz,项目名称:glaciar,代码行数:7,代码来源:RouteServiceProvider.php

示例3: initializationModule

 public function initializationModule()
 {
     $this->modulePath = app_path('Modules/' . $this->moduleName);
     //Config
     if (file_exists($this->modulePath . '/config.php')) {
         $this->mergeConfigFrom($this->modulePath . '/config.php', 'module' . $this->moduleName);
     }
     //Language
     if (is_dir($this->modulePath . '/Languages')) {
         $this->app->language->load($this->moduleName);
     }
     //Helper
     if (file_exists($this->modulePath . '/helpers.php')) {
         require $this->modulePath . '/helpers.php';
     }
     //View
     if (is_dir($this->modulePath . '/Views')) {
         $this->loadViewsFrom($this->modulePath . '/Views', $this->moduleName);
     }
     //Hook View
     if (isset($this->hookView)) {
         foreach ($this->hookView as $key => $value) {
             $this->app->config->set('hooks.' . $key, $value);
         }
     }
     //Widget
     if (isset($this->widget)) {
         foreach ($this->widget as $key => $value) {
             $this->app->widget->register($key, $value);
         }
     }
     //Cast
     if (isset($this->castPost)) {
         foreach ($this->castPost as $key => $value) {
             $this->app->config->set('site.cast.post.' . $key, $value);
         }
     }
     if (isset($this->castCategory)) {
         foreach ($this->castCategory as $key => $value) {
             $this->app->config->set('site.cast.category.' . $key, $value);
         }
     }
     //Permissions
     if (isset($this->permissions)) {
         foreach ($this->permissions as $key => $value) {
             $this->app->config->set('site.permissions.' . $key, $value);
         }
     }
     //Route
     if (file_exists($this->modulePath . '/Routes/web.php')) {
         Route::group(['middleware' => 'web', 'namespace' => 'App\\Modules\\' . $this->moduleName . '\\Controllers'], function ($router) {
             require $this->modulePath . '/Routes/web.php';
         });
     }
     if (file_exists($this->modulePath . '/Routes/api.php')) {
         Route::group(['middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => 'api'], function ($router) {
             require $this->modulePath . '/Routes/api.php';
         });
     }
 }
开发者ID:vnsource,项目名称:core,代码行数:60,代码来源:ServiceProviderTrait.php

示例4: boot

 public function boot()
 {
     $this->package('mrosati84/laradmin');
     $prefix = Config::get('laradmin::prefix');
     $namespace = Config::get('laradmin::namespace');
     $entities = Config::get('laradmin::entities');
     foreach ($entities as $entity => $properties) {
         $fullClassName = $namespace . '\\' . $entity . 'Admin';
         $baseAdminController = 'Mrosati84\\Laradmin\\BaseAdminController';
         // register admin classes bindings
         App::bind($fullClassName, function () use($fullClassName, $entity) {
             return new $fullClassName($entity);
         });
         // register custom filters classes
         App::bind('AuthenticationFilter', 'Mrosati84\\Laradmin\\Filters\\AuthenticationFilter');
         // register custom route filters
         Route::filter('laradmin.auth', 'AuthenticationFilter');
         // register laradmin index route (just a redirect to default entity)
         Route::get($prefix, array('as' => 'laradmin.index', function () use($prefix) {
             return Redirect::route($prefix . '.' . strtolower(Config::get('laradmin::defaultEntity')) . '.index');
         }));
         // register entities routes
         Route::group(array('prefix' => $prefix, 'before' => 'laradmin.auth'), function () use($entity, $fullClassName) {
             Route::resource(strtolower($entity), $fullClassName);
         });
     }
 }
开发者ID:mrosati84,项目名称:laradmin,代码行数:27,代码来源:LaradminServiceProvider.php

示例5: map

 /**
  * Define the routes for the application.
  *
  * @return void
  */
 public function map()
 {
     if (!$this->app->routesAreCached()) {
         Route::group(['namespace' => 'EscapeWork\\LaraMedias\\Http\\Controllers'], function () {
             require __DIR__ . '/../Http/routes.php';
         });
     }
 }
开发者ID:escapework,项目名称:laramedias,代码行数:13,代码来源:RouteServiceProvider.php

示例6: map

 /**
  * Define the routes for the application.
  *
  * @return void
  */
 public function map()
 {
     Route::group(['namespace' => $this->namespace], function ($router) {
         foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
             $this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
         }
     });
 }
开发者ID:Pterodactyl,项目名称:Panel,代码行数:13,代码来源:RouteServiceProvider.php

示例7: mapApiRoutes

 /**
  * Define the "api" routes for the theme. Routes are in two groups, those requiring
  * a user to be authenticated and another for routes that don't require any authentication.
  *
  * These routes are typically stateless.
  *
  * @return void
  */
 protected function mapApiRoutes()
 {
     Route::group(['middleware' => ['api', 'auth:api'], 'namespace' => 'App\\Http\\Controllers', 'prefix' => 'api'], function ($router) {
         $this->loadRouteFile('api');
     });
     Route::group(['middleware' => ['api'], 'namespace' => 'App\\Http\\Controllers', 'prefix' => 'api'], function ($router) {
         $this->loadRouteFile('api-no-auth');
     });
 }
开发者ID:petercoles,项目名称:themes,代码行数:17,代码来源:ThemesServiceProvider.php

示例8: registerRoutes

 public function registerRoutes()
 {
     Route::group(array('prefix' => Config::get('clumsy/form-builder::input-prefix'), 'before' => array_merge(array('clumsy'), (array) Config::get('clumsy/form-builder::input-filters-before')), 'after' => Config::get('clumsy/form-builder::input-filters-after')), function () {
         $sections = app('form-builder')->getSections();
         foreach ($sections->getAllItems() as $section) {
             Route::resource($section->getResource(), 'Clumsy\\FormBuilder\\Controllers\\FormController');
         }
     });
 }
开发者ID:Flipjms,项目名称:form-builder,代码行数:9,代码来源:FormBuilderServiceProvider.php

示例9: testRoutes

 public function testRoutes()
 {
     Route::group(['middleware' => ['web']], function () {
         Route::group(['middleware' => ['auth']], function () {
             Route::get('/happybirthday/test/now', '\\Willypuzzle\\Happybirthday\\Http\\Controllers\\TestController@now');
             Route::get('/happybirthday/test/date/{date}', '\\Willypuzzle\\Happybirthday\\Http\\Controllers\\TestController@date');
         });
     });
 }
开发者ID:willypuzzle,项目名称:happybirthday,代码行数:9,代码来源:Main.php

示例10: mapWebRoutes

 /**
  * Define the "web" routes for the application.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 protected function mapWebRoutes()
 {
     Route::group(['namespace' => $this->namespace, 'middleware' => config('amigridview.middleware'), 'prefix' => config('amigridview.prefix')], function ($router) {
         /** @var \Illuminate\Routing\Router $router */
         $routesFile = __DIR__ . '/../Http/routes.php';
         if (file_exists($routesFile)) {
             require $routesFile;
         }
     });
 }
开发者ID:assurrussa,项目名称:grid-view-vue,代码行数:16,代码来源:RouteServiceProvider.php

示例11: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     // Publish pieces
     if (!$this->isLumen()) {
         $this->publishes([__DIR__ . '/../config/mail-tracker.php' => config_path('mail-tracker.php')], 'config');
         $this->publishes([__DIR__ . '/../migrations/2016_03_01_193027_create_sent_emails_table.php' => database_path('migrations/2016_03_01_193027_create_sent_emails_table.php')], 'config');
         $this->publishes([__DIR__ . '/../migrations/2016_09_07_193027_create_sent_emails_Url_Clicked_table.php' => database_path('migrations/2016_09_07_193027_create_sent_emails_Url_Clicked_table.php')], 'config');
         $this->publishes([__DIR__ . '/../migrations/2016_11_10_213551_add-message-id-to-sent-emails-table.php' => database_path('migrations/2016_11_10_213551_add-message-id-to-sent-emails-table.php')], 'config');
         $this->loadViewsFrom(__DIR__ . '/views', 'emailTrakingViews');
         $this->publishes([__DIR__ . '/views' => base_path('resources/views/vendor/emailTrakingViews')]);
     }
     // Hook into the mailer
     $this->app['mailer']->getSwiftMailer()->registerPlugin(new MailTracker());
     // Install the routes
     $config = $this->app['config']->get('mail-tracker.route', []);
     $config['namespace'] = 'jdavidbakr\\MailTracker';
     if (!$this->isLumen()) {
         Route::group($config, function () {
             Route::get('t/{hash}', 'MailTrackerController@getT')->name('mailTracker_t');
             Route::get('l/{url}/{hash}', 'MailTrackerController@getL')->name('mailTracker_l');
             Route::post('sns', 'SNSController@callback')->name('mailTracker_SNS');
         });
     } else {
         $app = $this->app;
         $app->group($config, function () use($app) {
             $app->get('t', 'MailTrackerController@getT')->name('mailTracker_t');
             $app->get('l', 'MailTrackerController@getL')->name('mailTracker_l');
             $app->post('sns', 'SNSController@callback')->name('mailTracker_SNS');
         });
     }
     // Install the Admin routes
     $config_admin = $this->app['config']->get('mail-tracker.admin-route', []);
     $config_admin['namespace'] = 'jdavidbakr\\MailTracker';
     if (!$this->isLumen()) {
         Route::group($config_admin, function () {
             Route::get('/', 'AdminController@getIndex')->name('mailTracker_Index');
             Route::post('search', 'AdminController@postSearch')->name('mailTracker_Search');
             Route::get('clear-search', 'AdminController@clearSearch')->name('mailTracker_ClearSearch');
             Route::get('show-email/{id}', 'AdminController@getShowEmail')->name('mailTracker_ShowEmail');
             Route::get('url-detail/{id}', 'AdminController@getUrlDetail')->name('mailTracker_UrlDetail');
             Route::get('smtp-detail/{id}', 'AdminController@getSmtpDetail')->name('mailTracker_SmtpDetail');
         });
     } else {
         $app = $this->app;
         $app->group($config_admin, function () use($app) {
             $app->get('/', 'AdminController@getIndex')->name('mailTracker_Index');
             $app->post('search', 'AdminController@postSearch')->name('mailTracker_Search');
             $app->get('clear-search', 'AdminController@clearSearch')->name('mailTracker_ClearSearch');
             $app->get('show-email/{id}', 'AdminController@getShowEmail')->name('mailTracker_ShowEmail');
             $app->get('url-detail/{id}', 'AdminController@getUrlDetail')->name('mailTracker_UrlDetail');
             $app->get('smtp-detail/{id}', 'AdminController@getSmtpDetail')->name('mailTracker_SmtpDetail');
         });
     }
 }
开发者ID:jdavidbakr,项目名称:mail-tracker,代码行数:59,代码来源:MailTrackerServiceProvider.php

示例12: addRoutes

 protected function addRoutes($controllerNamespace, $routeFolder)
 {
     Route::group(['namespace' => $controllerNamespace, 'prefix' => config('trungtnm.backend.uri')], function () use($routeFolder) {
         // scan routes php file in route folder -> route folder should contain only Laravel routes define
         $pattern = $routeFolder . '/*.php';
         $modules = glob($pattern);
         foreach ($modules as $routerPath) {
             require $routerPath;
         }
     });
 }
开发者ID:trungtnm,项目名称:backend,代码行数:11,代码来源:TrungtnmBackendServiceProvider.php

示例13: map

 /**
  * Define the routes for the application.
  */
 public function map()
 {
     Route::group(['namespace' => $this->namespace], function (Registrar $router) {
         foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
             $namespace = basename($file, '.php');
             $router->group(['namespace' => $namespace], function (Registrar $router) use($namespace) {
                 $this->app->make("App\\Http\\Routes\\{$namespace}")->map($router);
             });
         }
     });
 }
开发者ID:baconfy,项目名称:skeleton,代码行数:14,代码来源:RouteServiceProvider.php

示例14: defineRoutes

 /**
  * Define the Spark routes.
  *
  * @return void
  */
 protected function defineRoutes()
 {
     $this->defineRouteBindings();
     // If the routes have not been cached, we will include them in a route group
     // so that all of the routes will be conveniently registered to the given
     // controller namespace. After that we will load the Spark routes file.
     if (!$this->app->routesAreCached()) {
         Route::group(['namespace' => 'Laravel\\Spark\\Http\\Controllers'], function ($router) {
             require __DIR__ . '/../Http/routes.php';
         });
     }
 }
开发者ID:defenestrator,项目名称:groid,代码行数:17,代码来源:SparkServiceProvider.php

示例15: auth

 public function auth()
 {
     $namespace = "\\CodePress\\CodeUser\\Controllers";
     Route::group(['namespace' => null], function () use($namespace) {
         Route::get('login', "{$namespace}\\Auth\\AuthController@showLoginForm");
         Route::post('login', "{$namespace}\\Auth\\AuthController@login");
         Route::get('logout', "{$namespace}\\Auth\\AuthController@logout");
         Route::get('password/reset/{token?}', "{$namespace}\\Auth\\PasswordController@showResetForm");
         Route::post('password/email', "{$namespace}\\Auth\\PasswordController@sendResetLinkEmail");
         Route::post('password/reset', "{$namespace}\\Auth\\PasswordController@reset");
     });
 }
开发者ID:netoudi,项目名称:laravel-tdd,代码行数:12,代码来源:Router.php


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