当使用它为“ controller@method”时,找不到返回控制器。在拉拉维尔
我正在尝试使步骤的资源路由与这样的链接中传递的ID一起使用,例如“/step/{howitwork:id}/create”,创建方法如下:
public function create(HowItWork $how){
...
}
因此,在我在控制器中定义资源路由之前:
Route::get('steps/{howitwork:id}/create/', [
'as' => 'steps.create',
'uses' => 'StepController@create'
]);
返回的应用程序是:
目标类[Stepcontroller]不存在。
I'm trying to make the resource route of steps work with id passed in the link like this "/steps/{howitwork:id}/create" and the create method looks like this:
public function create(HowItWork $how){
...
}
so before I define the resource route in the controller:
Route::get('steps/{howitwork:id}/create/', [
'as' => 'steps.create',
'uses' => 'StepController@create'
]);
what the app returning is:
Target class [StepController] does not exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您已经在资源路线下添加代码,然后尝试。
you have add code under the resource route and try with this.
我建议您使用此语法:
I suggest you to use this syntax: