php Illuminate-Contracts-Routing-Registrar类(方法)实例源码

下面列出了php Illuminate-Contracts-Routing-Registrar 类(方法)源码代码实例,从而了解它的用法。

作者:aksal    项目:Cache   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  *
  * @return void
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => ['web', 'ready']], function (Registrar $router) {
         $router->get('/atom/{component_group?}', ['as' => 'feed.atom', 'uses' => 'FeedController@atomAction']);
         $router->get('/rss/{component_group?}', ['as' => 'feed.rss', 'uses' => 'FeedController@rssAction']);
     });
 }

作者:annggee    项目:Cache   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => 'app.isSetup'], function ($router) {
         $router->get('/', ['as' => 'status-page', 'uses' => 'StatusPageController@showIndex']);
         $router->get('incident/{incident}', ['as' => 'incident', 'uses' => 'StatusPageController@showIncident']);
     });
 }

作者:minhkille    项目:Cache   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => ['app.hasSetting', 'localize'], 'setting' => 'app_name'], function ($router) {
         $router->get('/', ['as' => 'status-page', 'uses' => 'StatusPageController@showIndex']);
         $router->get('incident/{incident}', ['as' => 'incident', 'uses' => 'StatusPageController@showIncident']);
     });
 }

作者:tanten    项目:tanteng.m   
public function map(Registrar $router)
 {
     $router->group(['prefix' => 'test'], function ($router) {
         $router->get('/', ['uses' => 'TestController@test']);
         $router->get('/queue', ['uses' => 'TestController@queue']);
     });
 }

作者:aksal    项目:Cache   
/**
  * Define the signup routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  *
  * @return void
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => ['web', 'ready', 'guest'], 'as' => 'signup.'], function (Registrar $router) {
         $router->get('signup/invite/{code}', ['as' => 'invite', 'uses' => 'SignupController@getSignup']);
         $router->post('signup/invite/{code}', ['uses' => 'SignupController@postSignup']);
     });
 }

作者:emtud    项目:Gitami   
/**
  * Define the signup routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => ['app.hasSetting', 'guest'], 'setting' => 'app_name', 'as' => 'signup.'], function ($router) {
         $router->get('signup/invite/{code}', ['as' => 'invite', 'uses' => 'SignupController@getSignup']);
         $router->post('signup/invite/{code}', ['uses' => 'SignupController@postSignup']);
     });
 }

作者:anujaprasa    项目:Hiha   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     // Prevent access until the app is setup.
     $router->group(['middleware' => 'app.hasSetting', 'setting' => 'app_name'], function ($router) {
         $router->get('/', ['as' => 'status-page', 'uses' => 'HomeController@showIndex']);
     });
 }

作者:linguistictea    项目:laravel-boilerplat   
public function bind(Registrar $router)
 {
     $router->group(['prefix' => 'admin', 'namespace' => 'App\\Http\\Admin\\Controllers', 'middleware' => ['web', 'guest'], 'category' => 'Sentinel'], function (Registrar $sentinel) {
         $sentinel->get('dashboard', ['as' => 'admin.dashboard', 'uses' => 'Controller@index']);
         $sentinel->get('account/user', ['as' => 'admin.account.user', 'uses' => 'Sentinel\\AccountController@editAccountUser']);
         $sentinel->post('account/user-info/update', ['as' => 'admin.account.user.update', 'uses' => 'Sentinel\\AccountController@updateAccountUser']);
         $sentinel->get('account/person', ['as' => 'admin.account.person', 'uses' => 'Sentinel\\AccountController@editAccountPerson']);
         $sentinel->post('account/personal-info/update', ['as' => 'admin.account.person.update', 'uses' => 'Sentinel\\AccountController@updateAccountPerson']);
         $sentinel->get('system', ['as' => 'admin.settings.user.system', 'uses' => 'Sentinel\\AccountController@editSystem']);
         $sentinel->post('system/update', ['as' => 'admin.settings.user.system.update', 'uses' => 'Sentinel\\AccountController@updateSystem']);
     });
     $router->group(['prefix' => 'admin', 'namespace' => 'App\\Http\\Admin\\Controllers\\Sentinel', 'middleware' => ['web', 'guest', 'backendPermissions'], 'category' => 'Sentinel'], function (Registrar $sentinel) {
         $sentinel->resource('user', 'UserController');
         $sentinel->put('user/{userId}/restore', ['as' => 'admin.user.delete.restore', 'uses' => 'UserController@restore']);
         $sentinel->put('user/{userId}/activate', ['as' => 'admin.user.edit.activate', 'uses' => 'UserController@activate']);
         $sentinel->put('user/{userId}/deactivate', ['as' => 'admin.user.edit.deactivate', 'uses' => 'UserController@deactivate']);
         $sentinel->resource('group', 'GroupController');
         $sentinel->get('group/{group}/members', ['as' => 'admin.group.edit.members', 'uses' => 'GroupController@editMembers']);
         $sentinel->post('group/{group}/attach/{user}', ['as' => 'admin.group.add.attach', 'uses' => 'GroupController@attach']);
         $sentinel->delete('group/{group}/detach/{user}', ['as' => 'admin.group.delete.detach', 'uses' => 'GroupController@detach']);
     });
     $router->group(['prefix' => 'admin', 'namespace' => 'App\\Http\\Admin\\Controllers\\Sentinel', 'middleware' => ['web', 'guest'], 'category' => 'Sentinel'], function (Registrar $manager) {
         $manager->get('user/{user}/permissions/edit', ['as' => 'admin.user.permission.edit', 'uses' => 'PermissionController@edit']);
         $manager->post('user/{user}/{permission_type}/edit', ['as' => 'admin.user.permission.update', 'uses' => 'PermissionController@update']);
         $manager->get('group/{group}/permissions/edit', ['as' => 'admin.group.permission.edit', 'uses' => 'PermissionController@edit']);
         $manager->post('group/{group}/{permission_type}/edit', ['as' => 'admin.group.permission.update', 'uses' => 'PermissionController@update']);
         $manager->post('user/{user}/{permission_type}/toggle', ['as' => 'admin.user.permission.toggle', 'uses' => 'PermissionController@toggle']);
         $manager->post('group/{group}/{permission_type}/toggle', ['as' => 'admin.group.permission.toggle', 'uses' => 'PermissionController@toggle']);
     });
 }

作者:xiaobail    项目:Gitami   
/**
  * Define the groups routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     // Project Sub-routes groups.group_show, groups.group_edit
     $router->group(['middleware' => ['app.hasSetting', 'auth'], 'setting' => 'app_name', 'as' => 'owners.'], function ($router) {
         $router->get('{owner_path}', ['as' => 'owner_show', 'uses' => 'OwnersController@showAction'])->where('owner_path', '[a-zA-z.0-9_\\-]+');
     });
 }

作者:CMNati    项目:Cache   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  *
  * @return void
  */
 public function map(Registrar $router)
 {
     $router->group(['middleware' => ['web', 'ready', 'localize']], function ($router) {
         $router->get('/', ['as' => 'status-page', 'uses' => 'StatusPageController@showIndex']);
         $router->get('incident/{incident}', ['as' => 'incident', 'uses' => 'StatusPageController@showIncident']);
     });
 }

作者:shellofyo    项目:laravel-boilerplat   
/**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Contracts\Routing\Registrar  $router
  */
 public function map(Router $router)
 {
     if ($this->isEnabled()) {
         $router->group($this->routeAttributes(), function (Router $router) {
             LogViewerRoute::register($router);
         });
     }
 }

作者:anujaprasa    项目:Hiha   
/**
  * Define the status page routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     // Prevent access until the app is setup.
     $router->group(['middleware' => 'app.hasSetting', 'setting' => 'app_name'], function ($router) {
         $router->get('/atom/{component_group?}', 'AtomController@feedAction');
         $router->get('/rss/{component_group?}', 'RssController@feedAction');
     });
 }

作者:emtud    项目:Gitami   
/**
  * Define the feed routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     // Prevent access until the app is setup.
     $router->group(['middleware' => 'app.hasSetting', 'setting' => 'app_name'], function ($router) {
         $router->get('/atom/{project_group?}', ['as' => 'feed.atom', 'uses' => 'FeedController@atomAction']);
         $router->get('/rss/{project_group?}', ['as' => 'feed.rss', 'uses' => 'FeedController@rssAction']);
     });
 }

作者:arcanesof    项目:page   
/**
  * Define the foundation routes for the application.
  *
  * @param  \Illuminate\Contracts\Routing\Registrar  $router
  */
 private function mapBackEndRoutes(Router $router)
 {
     $attributes = array_merge($this->getFoundationRouteGroup(), ['as' => 'pages::foundation.', 'namespace' => 'Arcanesoft\\Pages\\Http\\Controllers\\Back']);
     $router->group(array_merge($attributes, ['prefix' => $this->getFoundationPagesPrefix()]), function (Router $router) {
         Routes\Back\StatsRoutes::register($router);
         Routes\Back\PagesRoutes::register($router);
     });
 }

作者:xiaobail    项目:Gitami   
/**
  * Define the auth routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['as' => 'auth.', 'middleware' => 'app.hasSetting', 'prefix' => 'auth', 'setting' => 'app_name'], function ($router) {
         $router->get('login', ['middleware' => 'guest', 'as' => 'login', 'uses' => 'AuthController@loginAction']);
         $router->post('login', ['middleware' => ['guest', 'csrf'], 'uses' => 'AuthController@loginPost']);
         $router->get('logout', ['as' => 'logout', 'uses' => 'AuthController@logoutAction', 'middleware' => 'auth']);
     });
 }

作者:arcanesof    项目:foundatio   
/**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Contracts\Routing\Registrar  $router
  */
 public function map(Router $router)
 {
     $router->group($this->getFoundationRouteGroup(), function (Router $router) {
         Routes\DashboardRoute::register($router);
         Routes\SettingsRoutes::register($router);
         Routes\SystemRoutes::register($router);
     });
 }

作者:JoeAlam    项目:Playliste   
/**
  * Define the auth routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['as' => 'auth.', 'namespace' => 'Auth', 'prefix' => 'auth'], function (Registrar $router) {
         // Login routes
         $router->get('login', ['middleware' => 'guest', 'as' => 'login', 'uses' => 'AuthController@showLogin']);
         $router->get('youtube', ['middleware' => 'guest', 'as' => 'login', 'uses' => 'AuthController@postLogin']);
         $router->get('logout', ['as' => 'logout', 'uses' => 'AuthController@logoutAction']);
     });
 }

作者:mnabiale    项目:laravel-simple-module   
/**
  * Load routes for active modules
  *
  * @param Registrar $router
  * @param string|null $type
  */
 public function loadRoutes(Registrar $router, $type = null)
 {
     $this->withRoutes($type)->each(function ($module) use($router, $type) {
         /* @var Module $module */
         $router->group(['namespace' => $module->routingControllerNamespace()], function ($router) use($module, $type) {
             $this->app['files']->getRequire($this->app->basePath() . DIRECTORY_SEPARATOR . $module->routesFilePath($module->routePrefix(compact('type'))));
         });
     });
 }

作者:ARCANESOF    项目:Foundatio   
/**
  * Map the admin routes.
  *
  * @param  \Illuminate\Contracts\Routing\Registrar  $router
  */
 private function mapAdminRoutes(Router $router)
 {
     $attributes = array_merge($this->getFoundationRouteGroup(), ['as' => 'admin::foundation.', 'namespace' => 'Arcanesoft\\Foundation\\Http\\Controllers\\Admin']);
     $router->group($attributes, function (Router $router) {
         Routes\Admin\DashboardRoute::register($router);
         Routes\Admin\SettingsRoutes::register($router);
         Routes\Admin\SystemRoutes::register($router);
     });
 }

作者:JoeAlam    项目:Playliste   
/**
  * Define the home routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->get('/', function () {
         $gc = app('Playlister\\Services\\YoutubeAPI\\YoutubeAPI')->getClient();
         $playlists = new \Google_Service_YouTube($gc);
         dd($playlists->playlists->listPlaylists('contentDetails,snippet', ['mine' => true]));
         return view('welcome');
     });
 }


问题


面经


文章

微信
公众号

扫码关注公众号