MethodNotAllowedHttpException在RouteCollection.php第218行中我能做什么?

MethodNotAllowedHttpException在RouteCollection.php第218行中我能做什么?,php,mysql,laravel,laravel-5.3,Php,Mysql,Laravel,Laravel 5.3,我目前正在开发一个论坛系统(laravel 5.3),我遇到了一个错误,可能是因为我的路由设置中设置了一些错误 <?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | This fil

我目前正在开发一个论坛系统(laravel 5.3),我遇到了一个错误,可能是因为我的路由设置中设置了一些错误

    <?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

Route::get('/', 'IndexController@index')->name('index');

Auth::routes();

Route::get('/index', 'IndexController@index')->name('index');
Route::get('/thread/{id}', 'ThreadController@showThread')->name('thread_detail');
Route::get('/privacybeleid', 'PagesController@privacyPolicy');
Route::get('/over-ons', 'PagesController@about');

Route::group(['middleware' => 'auth'], function() {

Route::get('/thread/nieuw', 'ThreadController@showForm')->name('thread_form');
Route::post('/thread', 'ThreadController@create')->name('create_thread');
Route::post('/thread/{id}/reply', 'CommentController@create')->name('create_comment');
});
尝试放置此路径:

Route::post('/thread/{id}/reply', 'CommentController@create')->name('create_comment');
在此之前:

Route::get('/thread/{id}', 'ThreadController@showThread')->name('thread_detail');

您可能必须选中编辑表单方法

{{ Form::open(['class' => 'form-horizontal', 'route' => ['create_comment', $thread->id], 'method' => 'PUT']) }}

如果这不起作用,请显示您试图提交到
create\u comment
route的表单。尝试放置默认路由
route::get('/','IndexController@index')->名称('索引')在底部,而不是在任何其他路由之前。不幸的是,我仍然收到相同的错误消息。但是我会正确地调整它。为什么不使用Route::post('/thread/reply/{id}',..)而不是作为您的实例?您能在视图中显示您的表单吗?请将您的代码保存在问题中并进行编辑。不是那样的回答下次我会注意的Alexey Mezenin:你是说在我的观点中?@Sygun是的,从观点来看我认为我有解决办法:回复是在线程页面本身内发送的,因此不需要路由(我猜)。但是为什么我不能创建一个新线程呢?“我的视图”中有一个页面,您可以在其中创建主题,但当您登录时,找不到该页面/thread/nieuw。您仍然需要路由。
{{ Form::open(['class' => 'form-horizontal', 'route' => ['create_comment', $thread->id], 'method' => 'PUT']) }}