本文整理汇总了PHP中Illuminate\Contracts\Routing\Registrar::group方法的典型用法代码示例。如果您正苦于以下问题:PHP Registrar::group方法的具体用法?PHP Registrar::group怎么用?PHP Registrar::group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Routing\Registrar
的用法示例。
在下文中一共展示了Registrar::group方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: map
/**
* Define the api routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
$router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => 'accept:application/json'], function ($router) {
// General
$router->get('ping', 'GeneralController@ping');
// Components
$router->get('components', 'ComponentController@getComponents');
$router->get('components/{component}', 'ComponentController@getComponent');
// Incidents
$router->get('incidents', 'IncidentController@getIncidents');
$router->get('incidents/{incident}', 'IncidentController@getIncident');
// Metrics
$router->get('metrics', 'MetricController@getMetrics');
$router->get('metrics/{metric}', 'MetricController@getMetric');
$router->get('metrics/{metric}/points', 'MetricController@getMetricPoints');
// Api protected
$router->group(['middleware' => 'auth.api'], function ($router) {
$router->post('components', 'ComponentController@postComponents');
$router->post('incidents', 'IncidentController@postIncidents');
$router->post('metrics', 'MetricController@postMetrics');
$router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
$router->put('components/{component}', 'ComponentController@putComponent');
$router->put('incidents/{incident}', 'IncidentController@putIncident');
$router->put('metrics/{metric}', 'MetricController@putMetric');
$router->put('metrics/{metric}/points/{metric_point}', 'MetricPointController@putMetricPoint');
$router->delete('components/{component}', 'ComponentController@deleteComponent');
$router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
$router->delete('metrics/{metric}', 'MetricController@deleteMetric');
$router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
});
});
}
示例2: map
/**
* Define the api routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
$router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => ['accept:application/json', 'timezone', 'auth.api.optional']], function ($router) {
// General
$router->get('ping', 'GeneralController@ping');
// Projects
$router->get('projects', 'ProjectController@getProjects');
$router->get('projects/teams', 'ProjectTeamController@getTeams');
$router->get('projects/teams/{project_team}', 'ProjectTeamController@getTeam');
$router->get('projects/{project}', 'ProjectController@getProject');
// Issues
$router->get('issues', 'IssueController@getIssues');
$router->get('issues/{issue}', 'IssueController@getIssue');
// Authorization Required
$router->group(['middleware' => 'auth.api'], function ($router) {
$router->get('subscribers', 'SubscriberController@getSubscribers');
$router->post('projects', 'ProjectController@postProjects');
$router->post('projects/teams', 'ProjectTeamController@postTeams');
$router->post('issues', 'IssueController@postIssues');
$router->post('subscribers', 'SubscriberController@postSubscribers');
$router->put('projects/teams/{project_team}', 'ProjectTeamController@putTeam');
$router->put('projects/{project}', 'ProjectController@putProject');
$router->put('issues/{issue}', 'IssueController@putIssue');
$router->delete('projects/teams/{project_team}', 'ProjectTeamController@deleteTeam');
$router->delete('projects/{project}', 'ProjectController@deleteProject');
$router->delete('issues/{issue}', 'IssueController@deleteIssue');
$router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
});
});
}
示例3: bind
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']);
});
}
示例4: map
/**
* Define the subscribe routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{
$router->group(['middleware' => ['web', 'ready', 'localize'], 'as' => 'subscribe.'], function ($router) {
$router->group(['middleware' => ['subscribers']], function ($router) {
$router->get('subscribe', ['as' => 'subscribe', 'uses' => 'SubscribeController@showSubscribe']);
$router->post('subscribe', ['uses' => 'SubscribeController@postSubscribe']);
});
$router->get('subscribe/verify/{code}', ['as' => 'verify', 'uses' => 'SubscribeController@getVerify']);
$router->get('unsubscribe/{code}/{subscription?}', ['as' => 'unsubscribe', 'uses' => 'SubscribeController@getUnsubscribe']);
});
}
示例5: map
/**
* Define the subscribe routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
$router->group(['middleware' => 'app.hasSetting', 'setting' => 'app_name'], function ($router) {
$router->group(['middleware' => 'app.subscribers'], function ($router) {
$router->get('subscribe', ['as' => 'subscribe-page', 'uses' => 'SubscribeController@showSubscribe']);
$router->post('subscribe', ['as' => 'subscribe', 'uses' => 'SubscribeController@postSubscribe']);
$router->get('subscribe/verify/{code}', ['as' => 'subscribe-verify', 'uses' => 'SubscribeController@getVerify']);
$router->get('unsubscribe/{code}', ['as' => 'unsubscribe', 'uses' => 'SubscribeController@getUnsubscribe']);
});
});
}
示例6: map
/**
* Define the groups routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
$router->group(['middleware' => ['app.hasSetting'], 'setting' => 'app_name', 'prefix' => 'groups', 'as' => 'groups.'], function ($router) {
$router->get('/', ['as' => 'index', 'uses' => 'GroupsController@indexAction']);
$router->get('new', ['as' => 'new', 'uses' => 'GroupsController@newAction']);
$router->post('create', ['as' => 'create', 'uses' => 'GroupsController@createAction']);
});
// Project Sub-routes groups.group_show, groups.group_edit
$router->group(['middleware' => ['app.hasSetting'], 'setting' => 'app_name', 'as' => 'groups.'], function ($router) {
$router->get('{owner_path}/edit', ['as' => 'group_edit', 'uses' => 'GroupsController@editAction'])->where('owner_path', '[a-zA-z.0-9_\\-]+');
$router->post('{owner_path}', ['as' => 'group_update', 'uses' => 'GroupsController@updateAction'])->where('owner_path', '[a-zA-z.0-9_\\-]+');
});
}
示例7: map
/**
* 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']);
$router->get('/atom/{component_group?}', 'AtomController@feedAction');
$router->get('/rss/{component_group?}', 'RssController@feedAction');
$router->group(['middleware' => 'app.subscribers'], function ($router) {
$router->get('subscribe', ['as' => 'subscribe-page', 'uses' => 'SubscribeController@showSubscribe']);
$router->post('subscribe', ['as' => 'subscribe', 'uses' => 'SubscribeController@postSubscribe']);
$router->get('subscribe/verify/{code}', ['as' => 'subscribe-verify', 'uses' => 'SubscribeController@getVerify']);
$router->get('unsubscribe/{code}', ['as' => 'unsubscribe', 'uses' => 'SubscribeController@getUnsubscribe']);
});
});
}
示例8: map
/**
* Define the status page routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{
$router->group(['middleware' => ['web'], 'namespace' => 'Projects'], function (Registrar $router) {
$router->get('{owner}/{project}/issues', ['as' => 'issues', 'uses' => 'IssueController@index']);
$router->get('{owner}/{project}/issues/new', ['as' => 'issue_new', 'uses' => 'IssueController@create']);
$router->post('{owner}/{project}/issues', ['as' => 'issue_store', 'uses' => 'IssueController@store']);
$router->get('{owner}/{project}/issues/{issue}', ['as' => 'issue_show', 'uses' => 'IssueController@show']);
$router->get('/{owner}/{project}/{branch}/rss', ['as' => 'rss', 'uses' => 'RssController@show']);
$router->get('{owner}/{project}/merge_requests', ['as' => 'merge_requests', 'uses' => 'MergeRequestController@index']);
$router->get('{owner}/{project}/commits/{commitishPath}', ['as' => 'commits', 'uses' => 'CommitController@index']);
$router->get('{owner}/{project}/commit/{commit}', ['as' => 'commit', 'uses' => 'CommitController@show']);
$router->get('{owner}/{project}/stats/{branch}', ['as' => 'stats', 'uses' => 'StatsController@show']);
$router->get('{owner}/{project}/network/{commitishPath}', ['as' => 'network', 'uses' => 'NetworkController@index']);
$router->get('{owner}/{project}/network_data/{commitishPath}/{page}', ['as' => 'networkData', 'uses' => 'NetworkController@data']);
$router->get('{owner}/{project}/treegraph/{commitishPath}', ['as' => 'treegraph', 'uses' => 'TreeGraphController@index']);
$router->get('{owner}/{project}/{format}ball/{branch}', ['as' => 'archive', 'uses' => 'TreeController@archive']);
$router->get('{owner}/{project}/blob/{commitishPath}', ['as' => 'blob', 'uses' => 'BlobController@index']);
$router->get('{owner}/{project}/raw/{commitishPath}', ['as' => 'blob_raw', 'uses' => 'BlobController@raw']);
$router->get('{owner}/{project}/blame/{commitishPath}', ['as' => 'blame', 'uses' => 'BlameController@show']);
$router->get('{owner}/{project}/tree/{commitishPath}/', ['as' => 'tree', 'uses' => 'TreeController@tree']);
$router->get('/{owner}/{project}', ['as' => 'repository', 'uses' => 'TreeController@index']);
$router->any('{owner}/{project}/tree/{branch}/search', ['as' => 'search', 'uses' => 'TreeController@search']);
$router->get('{owner}/{project}/{branch}', ['as' => 'branch', 'uses' => 'TreeController@tree']);
});
}
示例9: map
/**
* 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']);
});
}
示例10: map
/**
* 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']);
});
}
示例11: map
public function map(Registrar $router)
{
$router->group(['prefix' => 'test'], function ($router) {
$router->get('/', ['uses' => 'TestController@test']);
$router->get('/queue', ['uses' => 'TestController@queue']);
});
}
示例12: map
/**
* Define the admin routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
//Dashboard area
$router->group(['middleware' => ['auth', 'admin'], 'prefix' => 'admin', 'namespace' => 'Admin', 'as' => 'admin.'], function ($router) {
$router->get('/', ['as' => 'index', 'uses' => 'DashboardController@indexAction']);
// Settings
$router->group(['as' => 'settings.', 'prefix' => 'settings'], function ($router) {
$router->get('general', ['as' => 'general', 'uses' => 'SettingsController@showGeneralView']);
$router->get('localization', ['as' => 'localization', 'uses' => 'SettingsController@showLocalizationView']);
$router->get('timezone', ['as' => 'timezone', 'uses' => 'SettingsController@showTimezoneView']);
$router->get('theme', ['as' => 'theme', 'uses' => 'SettingsController@showThemeView']);
$router->get('stylesheet', ['as' => 'stylesheet', 'uses' => 'SettingsController@showStylesheetView']);
$router->post('/', 'SettingsController@postSettings');
});
});
}
示例13: map
/**
* 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']);
});
}
示例14: map
/**
* 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_\\-]+');
});
}
示例15: map
/**
* 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']);
});
}