我正在使用Route::资源作为我的项目路由。在我看来,我希望将project-〉id传递到project.update路由中。
这是我想做的:
{{route('project.update',$project->id)}}
我也试过:
{{route('project.update',[$project->id])}}
404 Not Found 404 Not Foundhttp://127.0.0.1:8000/project/%24project-%3Eid?activation=1)
路由列表:
GET|HEAD project/create ....................................................................... project.create › ProjectController@create
GET|HEAD project/{project} ........................................................................ project.show › ProjectController@show
PUT|PATCH project/{project} .................................................................... project.update › ProjectController@update
DELETE project/{project} .................................................................. project.destroy › ProjectController@destroy
GET|HEAD project/{project}/edit ................................................................... project.edit › ProjectController@edit
知道吗?谢谢
1条答案
按热度按时间9gm1akwq1#
找到了答案,只需要传递$project而不仅仅是id: