Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ilex01's avatar
Level 5

Missing required parameter for [Route: password.reset] [URI: {lang}/password/reset/{token}] [Missing parameter: lang].

Error:

Missing required parameter for [Route: password.reset] [URI: {lang}/password/reset/{token}] [Missing parameter: lang].

In web.php:

Route::group(['prefix' => '{lang}'], function () {	
	Route::get('/password/reset/{token}', function ($lang, $token) {
		// Vérifie si la langue est valide
		if (in_array($lang, ['en', 'fr'])) {
			// Définit la langue de l'application
			App::setLocale($lang);

			// Optionnellement, stocke la langue dans la session
			Session::put('locale', $lang);
		}

		return app(ResetPasswordController::class)->showResetForm($token);
	})->name('password.reset');
});
Route::post('{lang}/password/email', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email');

In blade:

<form method="POST" action="{{ route('password.email', ['lang' => app()->getLocale()]) }}">
@csrf
// ...
0 likes
17 replies
tykus's avatar

Why did you create another thread for this same issue??? I already told you how to change the ResetPassword notification

Also see the difference in the Route name in the error message compared with the Missing required parameter for [Route: password.reset] route you defined?

Route::post('{lang}/password/email', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email');

password.reset is not the same as password.email

ilex01's avatar
Level 5

@tykus I updated my question with ->name('password.reset'); code.

tykus's avatar

@ilex01 somewhere you are using the route, e.g. in the reset password email view template for the link, and did not pass the lang parameter:

{{ route('password.reset', ['lang' => session('locale', 'en'), 'token' => $token, 'email' => $user->email]) }}
ilex01's avatar
Level 5

@tykus But my route is:

<form method="POST" action="{{ route('password.email', ['lang' => app()->getLocale()]) }}">

And not:

{{ route('password.reset', ['lang' => session('locale', 'en'), 'token' => $token, 'email' => $user->email]) }}

I cannot find:

route('password.reset' // ...

nowhere in my code

tykus's avatar

@ilex01 there is a route named password.reset defined somewhere in your code, and somewhere that route is being used to generate the link (maybe in the email notification) for the user to click to see the reset form.

ilex01's avatar
Level 5

@tykus Sorry but I cannot find password.reset in my code.

ilex01's avatar
Level 5

Just here, in web.php:

Route::get('/password/reset/{token}', function ($lang, $token) {
	// Vérifie si la langue est valide
	if (in_array($lang, ['en', 'fr'])) {
		// Définit la langue de l'application
		App::setLocale($lang);

		// Optionnellement, stocke la langue dans la session
		Session::put('locale', $lang);
	}

	return app(ResetPasswordController::class)->showResetForm($token);
})->name('password.reset'); // only here
tykus's avatar

@ilex01 no. Besides why would that route be defined if it is not being used anywhere. Where are you searching; extend the search into the vendor directory.

tykus's avatar

@ilex01 so like I mentioned at the outset, you need to override that method so you can pass the required lang to the route helper.

ilex01's avatar
Level 5

@tykus I'm feeling a bit lost. Could you just provide the code directly, please?

tykus's avatar
tykus
Best Answer
Level 104

@ilex01 Make a new Notification

php artisan make:notification ResetPassword

and have it extend the framework's own implementation, and inside replace everything only with an implementation of resetUrl

// app/Notifications/ResetPassword.php
<?php 
namespace App\Notifications;

use Illuminate\Auth\Notifications\ResetPassword as BaseNotification;

class ResetPassword extends BaseNotification
{
   protected function resetUrl($notifiable)
    {
        if (static::$createUrlCallback) {
            return call_user_func(static::$createUrlCallback, $notifiable, $this->token);
        }

        return url(route('password.reset', [
            'lang' => session('locale', 'en'), // only when session is available!
            'token' => $this->token,
            'email' => $notifiable->getEmailForPasswordReset(),
        ], false));
    }
}

Finally, in the User model, override the sendPasswordResetNotification method (from the Trait) so that it uses your implementation instead:

public function sendPasswordResetNotification(#[\SensitiveParameter] $token)
    {
        $this->notify(new \App\Notifications\ResetPassword($token));
    }
2 likes
ilex01's avatar
Level 5

@tykus

It works for: https://i.gyazo.com/5dda91ff01ec7ef8aec236dabcfddb09.png

But not for: https://i.gyazo.com/1259173c0d2bf2f5dbdc7999b394448a.png

The error I get: https://i.gyazo.com/d7dd26758807b2e94710ef00ecf11918.png

Missing required parameter for [Route: password.update] [URI: {lang}/password/reset] [Missing parameter: lang].

In web.php:

Route::get('{lang}/password/reset/{token}', [App\Http\Controllers\Auth\ResetPasswordController::class, 'showResetForm'])->name('password.reset');

https://i.gyazo.com/82728ef0142f0139c1162161eb80b023.png

experimentor's avatar

@ilex01

In the reset.blade.php, I think you are not passing the $lang route parameter to the form action.

From your error image, please try replacing this line in reset.blade.php:

<form method="POST" action="{{ route("password.update", [ "lang" => $lang ]) }}" >

$lang should be sent from controller to view file.

1 like
ilex01's avatar
Level 5

Why am I getting an error with password.reset when the action in my form is password.email?

Please or to participate in this conversation.