Route::auth(); Route::group(['mIDdleware' => 'web'],function () {Route::group(['namespace' => 'admin','prefix' => 'admin','mIDdleware' => ['auth','role:admin']],function(){ Route::get('/home','HomeController@index'); Route::get('user/data',['as' => 'admin.user.data','uses'=>'UserController@userData']); Route::resource('user','UserController'); Route::get('merchant/data',['as' => 'admin.merchant.data','uses'=>'MerchantController@merchantData']); Route::resource('merchant','MerchantController'); Route::get('bcategory/data',['as' => 'admin.bcategory.data','uses'=>'BusinesscategoryController@bcategoyData']); Route::resource('bcategory','BusinesscategoryController'); Route::get('ccategory/data',['as' => 'admin.ccategory.data','uses'=>'CouponcategoryController@ccategoyData']); Route::resource('ccategory','CouponcategoryController'); Route::delete('image/{image}',['as' => 'admin.image.destroy','uses'=>'ImageController@destroy']); Route::put('image/{image}/primary',['as' => 'admin.image.updateprimary','uses'=>'ImageController@setPrimaryImage']);});Route::group(['namespace' => 'Merchant','prefix' => 'merchant','mIDdleware' => 'role:Merchant'],function(){ });});
任何人都可以告诉我为什么Web路由应用两次我只添加一次组中间件.
解决方法 进行更改以始终在RouteServiceProvIDer中调用Web中间件,因此无需在routes.PHP中指定它.更新Documentation说:
请记住,Web中间件组由RouteServiceProvIDer自动应用于您的默认routes.PHP文件.
总结以上是内存溢出为你收集整理的laravel-5.2 – Laravel 5.2:Web中间件应用了两次全部内容,希望文章能够帮你解决laravel-5.2 – Laravel 5.2:Web中间件应用了两次所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)