Php MethodNotAllowedHttpException与POST方法

Php MethodNotAllowedHttpException与POST方法,php,laravel-5.4,Php,Laravel 5.4,我对拉雷维尔很陌生,并且面临一些问题。在我提交表单后,我正在尝试创建一个注册页和facing MethodNotAllowedHttpException。我已经搜索了很多帖子,但仍然一无所获。有人能帮我弄清楚我该怎么办吗?这是我的密码 web.php Route::get('/farm/register', 'AccountsController@create'); Route::post('/farm', 'AccountsController@store'); public functio

我对拉雷维尔很陌生,并且面临一些问题。在我提交表单后,我正在尝试创建一个注册页和facing MethodNotAllowedHttpException。我已经搜索了很多帖子,但仍然一无所获。有人能帮我弄清楚我该怎么办吗?这是我的密码

web.php

Route::get('/farm/register', 'AccountsController@create');
Route::post('/farm', 'AccountsController@store');
public function store(Request $request)
{
    dd(request()->all());
}
<form method="POST" action="{{ URL::route('/farm') }}" >
{{ csrf_field() }}
accountscocontroller.php

Route::get('/farm/register', 'AccountsController@create');
Route::post('/farm', 'AccountsController@store');
public function store(Request $request)
{
    dd(request()->all());
}
<form method="POST" action="{{ URL::route('/farm') }}" >
{{ csrf_field() }}
register.blade.php

Route::get('/farm/register', 'AccountsController@create');
Route::post('/farm', 'AccountsController@store');
public function store(Request $request)
{
    dd(request()->all());
}
<form method="POST" action="{{ URL::route('/farm') }}" >
{{ csrf_field() }}

{{csrf_field()}}

我不确定这是否有效,但请尝试以下方法:

Route::post('/farm', 'AccountsController@store')->name('farm')

<form method="post" action="{{ route('farm') }}" >
{{ csrf_field() }}
Route::post('/farm','AccountsController@store')->名称('farm')
{{csrf_field()}}

这对我来说很有用。

可能已经晚了,但谢谢:)