久久久久久久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)確保您打開您的表單以使用該方法:

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']) !!}

如果你沒有使用 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)
主站蜘蛛池模板: 免费在线观看一区二区 | 成人午夜免费网站 | 国产在线中文字幕 | 在线看亚洲 | 91网在线观看 | 免费观看一级特黄欧美大片 | 亚洲精品视频免费观看 | 亚洲精品成人网 | 欧美黄色精品 | 久草久 | 国产精品特级片 | 免费看一级毛片 | 国产精品久久久久久久久久 | 91影院 | 无吗视频 | 亚洲欧美日本在线 | 在线免费黄色小视频 | 亚洲瑟瑟| 日本电影韩国电影免费观看 | 亚洲一区二区在线 | 91视频一区 | 亚洲网站在线观看 | 国产第二页 | 精品一区二区三区91 | 国产高清免费 | 久久久久国产精品 | 欧美成人猛片aaaaaaa | 日本一区二区三区在线观看 | 国产美女在线看 | 日韩午夜精品 | 国产精品人人做人人爽 | 久久99精品视频 | 在线一区二区三区 | 久草在线在线精品观看 | 999久久久久久久久 国产欧美在线观看 | 成人在线观看免费视频 | 亚洲视频免费在线观看 | 红桃视频一区二区三区免费 | 亚洲夜射 | 91极品视频 | 国产精品99久久久久久宅男 |