【问题标题】:Laravel 5.6 RouteLaravel 5.6 路线
【发布时间】:2018-02-22 12:53:40
【问题描述】:
This is the mean problem
I have controllers structures like this 

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

And i calling url in this way

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

i got this error 

Any Solution ?? thanks in advance guys

【问题讨论】:

    标签: laravel-5.6


    【解决方案1】:

    在对路由进行分组时,可以通过添加标志as来命名它们:

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

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

    【讨论】:

      【解决方案2】:

      解决办法是

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

      跳过管理员谢谢大家。

      【讨论】:

        猜你喜欢
        • 2018-12-09
        • 2019-07-10
        • 2019-03-31
        • 2018-11-22
        • 2018-07-19
        • 2018-08-01
        • 2018-09-26
        • 2018-09-28
        • 1970-01-01
        相关资源
        最近更新 更多