@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));
}