本文整理汇总了PHP中Illuminate\Support\Facades\Route::resource方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::resource方法的具体用法?PHP Route::resource怎么用?PHP Route::resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Route
的用法示例。
在下文中一共展示了Route::resource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
});
}
}
示例2: 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');
}
});
}
示例3: boot
/**
* ServiceProvider bootstrapping
*/
public function boot()
{
// publish migrations
$this->publishes([realpath(__DIR__ . '/migrations') => $this->app->databasePath() . '/migrations']);
// load views
if (is_dir(base_path() . '/resources/views/packages/kleshch-s/laravel-products-catalog')) {
$this->loadViewsFrom(__DIR__ . '/resources/views/packages/kleshch-s/laravel-products-catalog', 'prodCatViews');
} else {
$this->loadViewsFrom(__DIR__ . '/views', 'prodCatViews');
}
// register routes
require base_path() . '/app/Http/routes.php';
Route::resource('products', '\\Kleshchs\\ProdCatalog\\Controllers\\ProductController', ['excepts' => ['show']]);
}
示例4: routeFromConfig
public function routeFromConfig($routes)
{
$dev_mode_enabled = env('PLATFORM_ADMIN_DEVELOPMENT_MODE_ENABLED', false);
foreach ($routes as $route) {
// ignore developmentMode routes
if (!$dev_mode_enabled and isset($route['developmentMode']) and $route['developmentMode']) {
continue;
}
if ($route['type'] == 'resource') {
$name = $this->trimRouteName($route['name']);
$controller = $route['controller'];
$options = isset($route['options']) ? $route['options'] : [];
Route::group(['as' => 'platform.admin.'], function () use($name, $controller, $options) {
Route::resource($name, $controller, $options);
});
}
}
}
示例5: function
<?php
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Route;
use Orchestra\Support\Facades\Resources;
/**
* ajax routing
*/
Route::group(['namespace' => 'Hostbrute\\Uppy\\Controllers', 'before' => 'orchestra.auth'], function () {
Route::post('admin/ajax/picture-select', ['as' => 'picture-select', 'uses' => 'PictureController@ajax']);
});
Route::group(\Orchestra\App::group('orchestra/uppy', 'admin'), function () {
// Route to account/profile.
Route::group(['prefix' => 'uppy'], function () {
Route::resource('albums', 'Hostbrute\\Uppy\\Controllers\\AlbumController', ['except' => 'show']);
Route::get('albums/{id}/delete', ['uses' => 'Hostbrute\\Uppy\\Controllers\\AlbumController@delete', 'as' => 'admin.uppy.albums.delete']);
Route::resource('pictures', 'Hostbrute\\Uppy\\Controllers\\PictureController', ['except' => 'show']);
Route::get('pictures/{id}/delete', ['uses' => 'Hostbrute\\Uppy\\Controllers\\PictureController@delete', 'as' => 'admin.uppy.pictures.delete']);
});
});
示例6: function
Route::resource('teams', 'TeamController', ['except' => ['show']]);
Route::post('teams/search', 'TeamController@search');
Route::post('teams/{id}/invite', 'TeamController@inviteMember');
Route::get('teams/{id}/remove/{userId}', 'TeamController@removeMember');
/*
|--------------------------------------------------------------------------
| Admin
|--------------------------------------------------------------------------
*/
Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'admin'], function () {
/*
|--------------------------------------------------------------------------
| Users
|--------------------------------------------------------------------------
*/
Route::resource('users', 'UserController', ['except' => ['create', 'show']]);
Route::post('users/search', 'UserController@search');
Route::get('users/search', 'UserController@index');
Route::get('users/invite', 'UserController@getInvite');
Route::get('users/switch/{id}', 'UserController@switchToUser');
Route::post('users/invite', 'UserController@postInvite');
/*
|--------------------------------------------------------------------------
| Roles
|--------------------------------------------------------------------------
*/
Route::resource('roles', 'RoleController', ['except' => ['show']]);
Route::post('roles/search', 'RoleController@search');
Route::get('roles/search', 'RoleController@index');
});
});
示例7: function
//rotas API
Route::post('oauth/access_token', function () {
return Response::json(Authorizer::issueAccessToken());
});
Route::group(['prefix' => 'api', 'as' => 'api.', 'middleware' => 'oauth'], function () {
Route::get('authenticated', ['uses' => 'Api\\LoggedController@index']);
Route::patch('device_token', ['uses' => 'Api\\LoggedController@updateDeviceToken']);
Route::get('cupom/{code}', ['uses' => 'Api\\CupomController@show']);
//API CLIENT
Route::group(['prefix' => 'client', 'as' => 'client.', 'middleware' => 'oauth.checkrole:client'], function () {
Route::resource('order', 'Api\\Client\\ClientCheckoutController', ['except' => ['create', 'edit', 'destroy']]);
Route::get('products', ['uses' => 'Api\\Client\\ClientProductController@index']);
});
//API DELIVRYMAN
Route::group(['prefix' => 'deliveryman', 'as' => 'deliveryman.', 'middleware' => 'oauth.checkrole:deliveryman'], function () {
Route::resource('order', 'Api\\Deliveryman\\DeliverymanCheckoutController', ['except' => ['create', 'edit', 'destroy', 'store']]);
Route::patch('order/{id}/update-status', ['uses' => 'Api\\Deliveryman\\DeliverymanCheckoutController@updateStatus', 'as' => 'orders.update_status']);
Route::post('order/{id}/geo', ['as' => 'orders.geo', 'uses' => 'Api\\Deliveryman\\DeliverymanCheckoutController@geo']);
});
});
});
//rotas administrativas
Route::group(['prefix' => 'admin', 'as' => 'admin.', 'middleware' => 'auth.checkrole:admin'], function () {
Route::group(['prefix' => 'client'], function () {
Route::get('', ['as' => 'client.index', 'uses' => 'ClientAdminController@index']);
Route::get('create', ['as' => 'client.create', 'uses' => 'ClientAdminController@create']);
Route::get('destroy/{client_id}', ['as' => 'client.destroy', 'uses' => 'ClientAdminController@destroy']);
Route::get('edit/{client_id}', ['as' => 'client.edit', 'uses' => 'ClientAdminController@edit']);
Route::post('store', ['as' => 'client.store', 'uses' => 'ClientAdminController@store']);
Route::post('update/{client_id}', ['as' => 'client.update', 'uses' => 'ClientAdminController@update']);
});
示例8: function
|
*/
Route::group(['middleware' => ['throttle:60,1']], function () {
Route::post('/prod/scroll', 'FrontController@scrollProd');
});
Route::group(['middleware' => ['web']], function () {
Route::get('/', ['as' => 'home', 'uses' => 'FrontController@index']);
Route::get('/prod/{id}/{slug?}', 'FrontController@showProduct');
Route::get('mentions', 'FrontController@mentions');
Route::get('/cat/{id}/{slug?}', 'FrontController@showProductByCategory');
Route::get('/tag/{id}/{tag?}', 'FrontController@showProductByTags');
Route::get('contact', 'FrontController@showContact');
Route::post('storeContact', 'FrontController@storeContact');
Route::post('/prod', 'FrontController@orderProduct');
Route::post('/prod/modif', 'FrontController@orderModif');
Route::any('login', 'LoginController@login');
Route::get('logout', 'LoginController@logout');
Route::group(['middleware' => ['auth']], function () {
Route::get('moncompte', 'FrontController@monCompte');
Route::get('moncompte/detailOrder/{id}', 'FrontController@detailOrder');
Route::get('panier', 'FrontController@showPanier');
Route::get('panier/validate', 'FrontController@validatePanier');
Route::get('panier/confirmate', 'FrontController@confirmatePanier');
});
Route::group(['middleware' => ['auth', 'admin']], function () {
Route::resource('product', 'ProductController');
Route::get('product/{id}/status', 'ProductController@status');
Route::get('history', 'ProductController@history');
Route::resource('category', 'CategoryController');
});
});
示例9:
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;
Route::model('user', Config::get('auth.model'));
Route::resource('/admin/user', 'ZaLaravel\\LaravelUser\\Controllers\\AdminUserController');
Route::post('/admin/user/{user}/block', ['uses' => 'ZaLaravel\\LaravelUser\\Controllers\\AdminUserController@block', 'as' => 'admin.user.block']);
示例10: function
});
Route::get('asset-picker', 'Asset\\AssetPickerController@index');
Route::get('asset-manager', 'Asset\\AssetManagerController@index');
Route::resource('asset', 'Asset\\AssetController');
Route::group(['namespace' => 'People'], function () {
Route::get('people-manager', ['uses' => 'PeopleManager@index', 'as' => 'people-manager']);
Route::group(['prefix' => 'person'], function () {
Route::resource('{person}/group', 'PersonGroup');
Route::resource('{person}/site', 'PersonSite');
});
Route::resource('person', 'Person');
Route::resource('group/{group}/roles', 'GroupRole');
Route::resource('group', 'Group');
});
Route::get('template-manager', ['uses' => 'TemplateManagerController@index', 'as' => 'template-manager']);
Route::resource('template', 'TemplateController');
Route::get('page-manager', ['as' => 'page-manager', 'uses' => 'PageManager@index']);
Route::get('page', 'Page\\PageController@getIndex');
Route::group(['prefix' => 'page/{page}', 'namespace' => 'Page'], function () {
Route::post('version/template/{template}', 'Version@postTemplate');
Route::get('version/embargo', 'Version@getEmbargo');
Route::get('version/status', 'Version@getStatus');
Route::get('version/template', 'Version@getTemplate');
Route::post('version/embargo', 'Version@postEmbargo');
Route::post('version/status', 'Version@postStatus');
Route::post('version/template', 'Version@postTemplate');
Route::post('version/title', 'Version@postTitle');
Route::get('settings/admin', 'Settings@getAdmin');
Route::get('settings/children', 'Settings@getChildren');
Route::get('settings/delete', 'Settings@getDelete');
Route::get('settings/feature', 'Settings@getFeature');
示例11: function
Route::get('/', ['as' => 'home', 'uses' => 'FrontController@index']);
Route::get('cat/{id}/{slug?}', 'FrontController@showProductByCategory');
Route::get('tag/{id}/{slug?}', 'FrontController@showProductByTag');
Route::get('prod/{id}/{slug?}', 'FrontController@showProduct');
Route::post('storeCart', 'FrontController@storeCart');
Route::get('cart', 'FrontController@showCart');
Route::get('removeCart/{id}', 'FrontController@removeCart');
Route::post('quantityCart', 'FrontController@quantityCart');
Route::post('updateQuantity', 'FrontController@updateQuantity');
Route::get('contact', 'FrontController@showContact');
Route::post('storeContact', 'FrontController@storeContact');
Route::get('account', 'FrontController@account');
Route::get('register', 'RegisterController@register');
Route::post('storeUser', 'RegisterController@storeUser');
Route::group(['middleware' => ['throttle:60,1']], function () {
Route::any('login', 'LoginController@login');
});
Route::get('logout', 'LoginController@logout');
Route::group(['middleware' => ['auth', 'admin']], function () {
Route::resource('product', 'Admin\\ProductController');
Route::get('product/status/{id}', 'Admin\\ProductController@changeStatus');
Route::get('product/remove/{id}', 'Admin\\ProductController@confirmRemove');
Route::get('history', 'Admin\\HistoryController@index');
});
Route::group(['middleware' => ['auth']], function () {
Route::get('validateCart', 'FrontController@validateCart');
Route::get('confirmCart', 'FrontController@confirmCart');
Route::any('customer', 'RegisterController@customer');
Route::post('storeCustomer', 'RegisterController@storeCustomer');
});
});
示例12:
Route::get('frames', 'FramesController@index');
Route::get('frames/add', 'FramesController@add');
Route::post('frames/insert', 'FramesController@insert');
Route::get('frames/edit/{id}', 'FramesController@edit');
Route::post('frames/update/{id}', 'FramesController@update');
Route::get('frames/delete/{id}', 'FramesController@delete');
Route::get('categories', 'CategoriesController@index');
Route::get('categories/add', 'CategoriesController@add');
Route::post('categories/insert', 'CategoriesController@insert');
Route::get('categories/edit/{id}', 'CategoriesController@edit');
Route::post('categories/update/{id}', 'CategoriesController@update');
Route::get('categories/delete/{id}', 'CategoriesController@delete');
Route::get('hairstyles', 'HairstylesController@index');
Route::get('hairstyles/add', 'HairstylesController@add');
Route::post('hairstyles/insert', 'HairstylesController@insert');
Route::get('hairstyles/edit/{id}', 'HairstylesController@edit');
Route::get('hairstyles/edit/midpoint/{id}', 'HairstylesController@midpoint');
Route::post('hairstyles/update/{id}', 'HairstylesController@update');
Route::post('hairstyles/updatepoint/{id}', 'HairstylesController@updatePoint');
Route::get('hairstyles/delete/{id}', 'HairstylesController@delete');
Route::get('clients', 'ClientsController@index');
Route::get('clients/add', 'ClientsController@add');
Route::post('clients/insert', 'ClientsController@insert');
Route::get('clients/edit/{id}', 'ClientsController@edit');
Route::post('clients/update/{id}', 'ClientsController@update');
Route::get('clients/delete/{id}', 'ClientsController@delete');
Route::resource('api/hairstyles', 'API\\HairstylesController');
Route::resource('api/frames', 'API\\FramesController');
Route::resource('api/categories', 'API\\CategoriesController');
Route::resource('api/check', 'API\\ClientsController');
示例13:
//Resources opened for all visitors
Route::resource('pert/taches', 'Pert\\PertController');
// Special url for visitors
Route::get('pert/taches/{id}/{pid}/{key}', 'Pert\\PertController@show');
//Resources opened also to Visitors
Route::resource('kanban/taches', 'Kanban\\KanbanController');
// Special url for visitors
Route::get('kanban/taches/{id}/{pid}/{key}', 'Kanban\\KanbanController@show');
//for connected developers to make task in done state
Route::resource('finishtask/taches', 'FinishTask\\FinishTaskController');
//Only connected users can see those resources
Route::resource('taketache/taches', 'TakeTache\\TakeTacheController');
//Only connected users can see those resources
Route::resource('taches/taches', 'Taches\\TachesController');
//Open resources for all visitor
Route::resource('tachesv/taches', 'TachesVisitor\\TachesVisitorController');
Route::get('home', '\\App\\Http\\Controllers\\HomeController@index');
//Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
//Route::get('backlog/{idProject}','BacklogController@show');
Route::get('backlog/{idProject}/{key?}', 'BacklogController@show');
Route::get('project/new', 'ProjectController@show');
Route::get('project/add', 'ProjectController@add');
Route::get('project/list', 'ProjectController@projectList');
Route::get('project/disply/{idProject}', 'ProjectController@disply');
Route::get('backlog/userstory/create/{idProject}', 'UsController@create');
Route::get('backlog/userstory/modify/{idUs}', 'UsController@modify');
Route::post('backlog/userstory/create/confirm/{idProject}', 'UsController@createConfirm');
Route::post('backlog/userstory/modify/confirm/{idProject}', 'UsController@modifyConfirm');
示例14: function
Route::get('login', ['as' => 'getLogin', 'uses' => 'Auth\\AuthController@getLogin']);
Route::post('login', ['as' => 'postLogin', 'uses' => 'Auth\\AuthController@postLogin']);
Route::auth();
Route::group(['middleware' => 'auth'], function () {
Route::get('/sort/{table}', 'PagesController@sort');
Route::get('logout', ['as' => 'logout', 'uses' => 'Auth\\AuthController@logout']);
Route::get('dashboard', ['as' => 'dashboard', 'uses' => 'PagesController@dashboard']);
Route::get('users/subscribed', 'UsersController@subscribed');
Route::get('users/toggleFeatured', 'UsersController@toggleIsFeaturedUser');
Route::resource('users', 'UsersController');
Route::get('feeds/spam', 'FeedsController@spamFeeds');
Route::get('feeds/spam/{id}', 'FeedsController@deleteSpamFeed');
Route::resource('feeds', 'FeedsController');
Route::resource('categories', 'VideoCategoriesController');
Route::resource('videos', 'VideosController');
Route::resource('nutrition', 'MealsController');
Route::resource('schools', 'SchoolsController');
Route::resource('schedules', 'WorkoutSchedulesController');
Route::resource('store/categories', 'ItemCategoriesController');
Route::resource('store/items', 'ItemsController');
Route::resource('subscriptions', 'SubscriptionsController');
Route::resource('referrals', 'ReferralsController');
Route::resource('ambassadors', 'AmbassadorsController');
Route::resource('orders', 'OrdersController');
Route::resource('positions', 'PositionsController');
Route::resource('nba_teams', 'NbaTeamsController');
Route::resource('favorite_shoe_brands', 'FavoriteShoeBrandsController');
Route::resource('sponsors', 'SponsorsController');
Route::resource('plans', 'MealPlansController');
});
});
示例15: array
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\View;
// Session Routes
Route::get('login', array('as' => 'login', 'uses' => 'Edgji\\Sentrystart\\SessionController@create'));
Route::get('logout', array('as' => 'logout', 'uses' => 'Edgji\\Sentrystart\\SessionController@destroy'));
Route::resource('sessions', 'Edgji\\Sentrystart\\SessionController', array('only' => array('create', 'store', 'destroy')));
// User Routes
Route::get('register', 'Edgji\\Sentrystart\\UserController@create');
Route::get('users/{id}/activate/{code}', 'Edgji\\Sentrystart\\UserController@activate')->where('id', '[0-9]+');
Route::get('resend', array('as' => 'resendActivationForm', function () {
return View::make('sentrystart:users.resend');
}));
Route::post('resend', 'Edgji\\Sentrystart\\UserController@resend');
Route::get('forgot', array('as' => 'forgotPasswordForm', function () {
return View::make('sentrystart::users.forgot');
}));
Route::post('forgot', 'Edgji\\Sentrystart\\UserController@forgot');
Route::post('users/{id}/change', 'Edgji\\Sentrystart\\UserController@change');
Route::get('users/{id}/reset/{code}', 'Edgji\\Sentrystart\\UserController@reset')->where('id', '[0-9]+');
Route::get('users/{id}/suspend', array('as' => 'suspendUserForm', function ($id) {
return View::make('sentrystart::users.suspend')->with('id', $id);
}));
Route::post('users/{id}/suspend', 'Edgji\\Sentrystart\\UserController@suspend')->where('id', '[0-9]+');
Route::get('users/{id}/unsuspend', 'Edgji\\Sentrystart\\UserController@unsuspend')->where('id', '[0-9]+');
Route::get('users/{id}/ban', 'Edgji\\Sentrystart\\UserController@ban')->where('id', '[0-9]+');
Route::get('users/{id}/unban', 'Edgji\\Sentrystart\\UserController@unban')->where('id', '[0-9]+');
Route::resource('users', 'Edgji\\Sentrystart\\UserController');
// Group Routes
Route::resource('groups', 'Edgji\\Sentrystart\\GroupController');