'owne-6ren">
gpt4 book ai didi

php - (1/1) MethodNotAllowedHttpException

转载 作者:行者123 更新时间:2023-11-29 03:19:04 24 4
gpt4 key购买 nike

我正在尝试通过写入 web.php

路由到 edit.blade.php 来更新行
"Route::get('/owner-information/edit/{id}', ['as' => 'owner-information.edit', 'uses' => 'OwnerInformatiionController@edit']);

并且在 index.blade.php

{{ route('owner-information.update', $owner_info->id) }}

点击更新后显示以下错误:

(1/1) MethodNotAllowedHttpException
in RouteCollection.php (line 251)
at RouteCollection->methodNotAllowed(array('GET', 'HEAD', 'POST'))
in RouteCollection.php (line 238)
at RouteCollection->getRouteForMethods(object(Request), array('GET', 'HEAD',
'POST'))
in RouteCollection.php (line 176)
at RouteCollection->match(object(Request))
in Router.php (line 546)
at Router->findRoute(object(Request))
in Router.php (line 525)

最佳答案

为更新创建一个post路由

    Route::post('routeName','OwnerInformatiionController@update');

关于php - (1/1) MethodNotAllowedHttpException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48237165/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com