缺少[Route:get:manage_products] [URI:admin / manage-products / {id}]所需的参数?

时间:2018-05-04 11:10:58

标签: php laravel web-deployment laravel-5.5

当我在Laravel 5.5中传递URL中的数据时出现以下错误。

  

缺少[Route:get:manage_products]所需的参数[URI:   管理员/管理产品/ {ID}]。 (视图:   /home/xxxxxx/public_html/xxxx/resources/views/admin/layout/include/sidebar.blade.php)   (视图:   /home/xxxxxxx/public_html/xxxxxx/resources/views/admin/layout/include/sidebar.blade.php)   (视图:   /home/xxxxxx/public_html/xxxxx/resources/views/admin/layout/include/sidebar.blade.php)

我的代码如下所示

web.php

Route::get('manage-products/{id}', ['as' => 'get:manage_products', 'uses' => 'AdminController@getManageProducts']);

select_store.blade.php

<p><a href="{{ route('get:manage_products', $store->id) }}">Go To Store</a></p>

admincontroller.php

public function getManageProducts($id)
    {
   //
}

我无法弄清楚问题所在。

1 个答案:

答案 0 :(得分:1)

尝试route('get:manage_products', ['id' => $store->id])