首页  >  文章  >  后端开发  >  laravel5 表单method无法用put,delete,patch?

laravel5 表单method无法用put,delete,patch?

WBOY
WBOY原创
2016-06-06 20:25:131162浏览

我按照文档的写法编写表单如下:

<code><input type="hidden" name="_method" value="PUT">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="title">
<input type="submit"></code>


但是得到的结果是: MethodNotAllowedHttpException in RouteCollection.php line 219:
如果是get post是正常的restful访问,单换了put...就不行。

回复内容:

我按照文档的写法编写表单如下:

<code><input type="hidden" name="_method" value="PUT">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="title">
<input type="submit"></code>


但是得到的结果是: MethodNotAllowedHttpException in RouteCollection.php line 219:
如果是get post是正常的restful访问,单换了put...就不行。

路由不对?
你有一个 Route::put('admin/haha/ht') 的路由吗?

路由里面有写对应的put吗

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn