如何解决laravel 5.3中RouteCollection.php中的MethodNotAllowedHttpException? [重复]

This question already has an answer here:

My view is like this :

{!! Form::open(['route' => ['users.store.year.month', $year, $month]]) !!}                
    @include('users.fields')
{!! Form::close() !!}

My route is like this :

Route::get('users/store/{year}/{month}', 'UserController@store')
        ->name('users.store.year.month');

My controller is like this :

public function store(CreateTunkinRequest $request, $thang, $month)
{
    ...
    return redirect(route('users.proses', ['month' => $month, 'year' => $year]));
}

When I input data and save, there exist error like this :

MethodNotAllowedHttpException in RouteCollection.php line 218:

How can I solve it?

</div>

When you are using laravel collective by default, a POST method will be assumed, so change your form to

{!! Form::open(['route' => ['users.store.year.month', $year, $month] , 'method' => 'get']) !!}

See https://laravelcollective.com/docs/5.3/html#opening-a-form

You may get this error, when you are making a GET request on a POST route, or vice versa. You are using Route::get, but your form's default method is POST.