如何在路线开头设置管理员,例如路线组集合中的&#39; / admin / attributes / 1 / edit而不仅仅是/ attributes / 1 / edit < / p>
Route::group(array('before' => 'Admin'), function() {
Route::resource('attributes', 'AttributesController');
Route::resource('brands', 'BrandsController');
Route::resource('products', 'ProductsController');
Route::resource('tags', 'TagsController');
Route::resource('roles', 'RolesController');
Route::resource('suppliers', 'SuppliersController');
});
答案 0 :(得分:4)
您需要使用prefix
Route::group(array('prefix' => 'admin'), function()
{
// routes here
});