Well i think there is no other good way to handle it, so i just implemented sendPasswordResetNotification() with custom Password reset notification. It works fine.
[Laravel 5.3] Change URL in reset password link with Mulit Auth
I want to change url which is hardcoded in Illuminate\Auth\Notifications\ResetPassword. The change must be done in Model class, becouse different models could have diffrent urls for reset passwords (multi auth).
/**
* Build the mail representation of the notification.
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail()
{
return (new MailMessage)
->line('You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', url('password/reset', $this->token)) // <- this url
->line('If you did not request a password reset, no further action is required.');
}
One way is to override in Model's class sendPasswordResetNotification from use Illuminate\Auth\Passwords\CanResetPassword but i am doing it for my Laravel 5.3 multi-auth package (https://github.com/Hesto/multi-auth) and i think its a bad idea to create new class especially for that reset email.
**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
Do you have any idea how can i handle it? I can't let it go because when i reset password with my package, for example from admin guard, i get wrong reset link.
Please or to participate in this conversation.