T
T
tol642020-01-18 19:55:27
Laravel
tol64, 2020-01-18 19:55:27

How to get rid of Missing required parameters for [Route: password.reset] [URI: {locale}/password/reset/{token}] error?

The error occurs when trying to reset the password. On the test files of the framework, everything works well. But after changing the routes, an error occurs when trying to reset the password. On the authorization and registration forms, everything is fine.
web.php

Route::group([
    'prefix' => '{locale}',
    'where' => ['locale' => '[a-zA-Z]{2}'],
    'middleware' => 'setlocale'
], function () {
    Route::get('/', function () {
        return view('index');
    });
    Auth::routes();
});

Result
Illuminate\Routing\Exceptions\UrlGenerationException
Missing required parameters for [Route: password.reset] [URI: {locale}/password/reset/{token}].

Please tell me how to solve this problem. I understand that the {token} parameter is not passed, but I still don’t know how to pass it in such a scheme.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jazzus, 2020-01-18
@tol64

Because a new locale variable is added to all auth routes; it must be passed as the first argument in all routes, otherwise there will be errors. In this case, in the ResetPassword notification in the line
Nothing can be changed in the vendor. You need your own files and methods, how to do it in Google there is a lot of material.
You need to go through all the routes, search for the name of the route (for example, here 'password.reset') and add the locale as the first argument.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question