久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

RouteCollection.php 第 219 行中的 MethodNotAllowedHttpExc

MethodNotAllowedHttpException in RouteCollection.php line 219(RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException)
本文介紹了RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

當(dāng)我存儲(chǔ)帖子時(shí)出現(xiàn)此錯(cuò)誤

When I storing a post I get this error

MethodNotAllowedHttpException in RouteCollection.php line 219:

什么會(huì)導(dǎo)致這個(gè)問(wèn)題??

What can cause this problem ??

Routes.php:

Routes.php:

Route::get('home', 'PostsController@index');
Route::get('/', 'PostsController@index');
Route::get('index', 'PostsController@index');

Route::get('posts', 'PostsController@index');
Route::get('post/{slug}/{id}', 'PostsController@show');
Route::get('posts/sukurti-nauja-straipsni', 'PostsController@create');
Route::patch('posts/store-new-post', 'PostsController@store');
Route::get('post/{slug}/{id}/edit', 'PostsController@edit');
Route::patch('posts/{slug}', 'PostsController@update');


Route::get('tags/{tags}', 'TagsController@show');
Route::get('categories/{categories}', 'CategoriesController@show');

// Authentication routes...
Route::get('auth/login', 'AuthAuthController@getLogin');
Route::post('auth/login', 'AuthAuthController@postLogin');
Route::get('auth/logout', 'AuthAuthController@getLogout');

// Registration routes...
Route::get('auth/register', 'AuthAuthController@getRegister');
Route::post('auth/register', 'AuthAuthController@postRegister');

我正在使用 Laravel 5.1,但我一天都想不通..

I'm using Laravel 5.1 and I can't figure this out for a day..

推薦答案

由于您將帖子更新的方法設(shè)置為 patch,請(qǐng)確保您打開(kāi)您的表單以使用該方法:

Since you're setting the method on the post's update to be patch, be sure you open your form to use that method:

{!! Form::open(['method' => 'patch']) !!}

如果你沒(méi)有使用 Form 類,你也可以確保有一個(gè) 隱藏在表單下面的名為 _method 的元素:

If you're not using the Form class, you can also just ensure there's a hidden element called _method underneath the form:

<input name="_method" type="hidden" value="PATCH">

同樣,如果您通過(guò) AJAX 發(fā)送此數(shù)據(jù),只需在通過(guò) POST 發(fā)送請(qǐng)求之前將 _method 鍵添加到設(shè)置為 'PATCH' 的有效負(fù)載中.某些瀏覽器(IE 7/8)不支持通過(guò) XMLHttpRequest 的 PATCH HTTP

Similarly, if you're sending this data via AJAX, just add a _method key to the payload set to 'PATCH' before sending the request via POST. Some browsers (IE 7/8) do not support PATCH HTTP through XMLHttpRequest

您的另一個(gè)選擇是更改您的路由以接受 POST 數(shù)據(jù):

Your other option is to change your route to accept POST data instead:

Route::post('posts/store-new-post', 'PostsController@store');
Route::post('posts/{slug}', 'PostsController@update');

這篇關(guān)于RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Magento products by categories(按類別劃分的 Magento 產(chǎn)品)
Resource interpreted as image but transferred with MIME type text/html - Magento(資源被解釋為圖像但使用 MIME 類型 text/html 傳輸 - Magento)
Is there an event for customer account registration in Magento?(Magento 中是否有客戶帳戶注冊(cè)事件?)
Magento addFieldToFilter: Two fields, match as OR, not AND(Magento addFieldToFilter:兩個(gè)字段,匹配為 OR,而不是 AND)
quot;Error 404 Not Foundquot; in Magento Admin Login Page(“未找到錯(cuò)誤 404在 Magento 管理員登錄頁(yè)面)
Get Order Increment Id in Magento(在 Magento 中獲取訂單增量 ID)
主站蜘蛛池模板: 久久精品亚洲国产奇米99 | 欧美性受| 亚洲午夜精品一区二区三区他趣 | 中文字幕一区在线 | 中文字幕日韩一区二区 | 久久久免费 | 国产精品久久国产精品 | 久久久久久综合 | 日韩精品在线网站 | 久久国产精品免费一区二区三区 | 欧美日韩中文在线 | 亚洲精品久久久一区二区三区 | 日韩在线中文字幕 | 成人午夜视频在线观看 | 81精品国产乱码久久久久久 | 91中文视频 | 亚洲精品大片 | 午夜a v电影 | 亚洲精品免费视频 | 色狠狠一区| 亚洲精品电影网在线观看 | 狠狠插天天干 | 国产日韩视频 | 亚洲国产欧美一区二区三区久久 | 成人午夜精品 | 黄色在线免费播放 | 91污在线 | 国产精品福利久久久 | 国产精品视频一二三 | 一区二区三区日韩 | 久久久久精 | 日韩国产中文字幕 | 一级毛片视频 | 91视频一88av | 女生羞羞网站 | 久久av.com| 成人国产一区二区三区精品麻豆 | 久久亚洲一区 | 久久久久免费 | 亚洲福利在线观看 | www.狠狠操 |