简体   繁体   English

RouteCollection.php第218行中的MethodNotAllowedHttpException关于更新数据的laravel 5.2

[英]MethodNotAllowedHttpException in RouteCollection.php line 218 laravel 5.2 on update data

Please help me, im newbie in laravel and get an error when I will update data field from button, like this 请帮助我,我是laravel的新手,当我从按钮更新数据字段时出现错误,就像这样

MethodNotAllowedHttpException in RouteCollection.php line 218: RouteCollection.php第218行中的MethodNotAllowedHttpException:

and im using Routes : 和即时通讯使用Routes

Route::post('/verify', 'DataPelamarController@verify');

and I write my Controller like bellow: 我像下面这样写我的控制器

public function verify(Request $request, $id){
    DB::table('databeasiswas')->update([
        'status_pendaftaran'=>'1']);
    return redirect(url('pendaftar'));
}

and this is my view 这是我的看法

<a href ="{{ url('verify') }}" name="_method" type="hidden" value="PATCH" >
  <button type="submit" class="btn btn-vk btn-sm"><i class="fa fa-check"></i> Verify Data</button>
</a>

thanks before.. 之前谢谢..

Just change this line. 只需更改此行。 Patch is for updating, Post for new db entries. 补丁用于更新,发布用于新的数据库条目。 This is just a convention. 这只是一个约定。 You can use post for both. 您可以同时使用post。

Route::patch('/verify', 'DataPelamarController@verify');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RouteCollection.php行218 Laravel 5.2中的MethodNotAllowedHttpException - MethodNotAllowedHttpException in RouteCollection.php line 218 Laravel 5.2 RouteCollection.php第218行中的Laravel MethodNotAllowedHttpException: - Laravel MethodNotAllowedHttpException in RouteCollection.php line 218: Laravel中RouteCollection.php第218行的MethodNotAllowedHttpException - MethodNotAllowedHttpException in RouteCollection.php line 218 in Laravel RouteCollection.php 第 218 行中的 Laravel 5.2.36 MethodNotAllowedHttpException: - Laravel 5.2.36 MethodNotAllowedHttpException in RouteCollection.php line 218: Laravel表单提交在RouteCollection.php第218行显示MethodNotAllowedHttpException: - Laravel form submit showing MethodNotAllowedHttpException in RouteCollection.php line 218: laravel 5.3 RouteCollection.php第218行中的MethodNotAllowedHttpException: - laravel 5.3 MethodNotAllowedHttpException in RouteCollection.php line 218: RouteCollection.php第218行中的Laravel XMLHttpRequest MethodNotAllowedHttpException: - Laravel XMLHttpRequest MethodNotAllowedHttpException in RouteCollection.php line 218: routecollection.php第218行中的methodnotallowedhttpexception - methodnotallowedhttpexception in routecollection.php line 218 RouteCollection.php第218:4行中的MethodNotAllowedHttpException - MethodNotAllowedHttpException in RouteCollection.php line 218:4 Laravel 5.2:RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException - Laravel 5.2 : MethodNotAllowedHttpException in RouteCollection.php line 219
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM