Laravel 5.6路线

时间:2018-02-22 12:53:40

标签: laravel-5.6

This is the mean problem
I have controllers structures like this 

File Structures

And i am using this syntax to make routes which is worked good for me

web/routes

And i calling url in this way
  

{{route('admin.categories.show',[$ category-> id])}}

i got this error 

Error

Any Solution ?? thanks in advance guys

2 个答案:

答案 0 :(得分:1)

对路线进行分组时,可以通过添加标记as

来命名它们
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function (){
    Route::resource('categories', 'Admin/CategoryController');
});

现在应该可以访问route('admin.categories.show')

答案 1 :(得分:0)

解决方案是

  

{{route('categories.show',[$ category-> id])}}

跳过管理员感谢每一个人。