如何为下面的相同路由创建多个请求。删除一条记录给了我一个在laravel 5中的NotFoundException
Route.php
Route::get('/home', '[email protected]');//->middleware('auth');
Route::get('/home/{$user}','[email protected]');
Route::delete('/home/{$studentId}','[email protected]');
形式工作正常,直到我添加删除请求。在我的刀片模板中,我有这样的代码。
home.blade.php
<form class="" role="form" method="DELETE" action="/home/{{$student->id}}">
{{ csrf_field() }}
<td><button type="submit" class="btn btn-primary pull-right">Remove Student</button></td>
</form>
我相信,因为它显示NotFoundHTTPException在相同航线。
在一条路线/家我试图添加,显示,编辑和删除一个记录与不同的按钮。
在此先感谢。
他要删除,但是......你刚从laravel网站上复制'<输入名称= “_method”type =“hidden”value =“PUT”>'。错误的答案。 –
哇..这样的接受降级..你们是残酷的,永远不会给我们一个机会.. –