The link is set in Illuminate\Auth\Notifications\ResetPassword
. This is the notification being sent out on a password reset request.
This notification is initialized in Illuminate\Auth\Passwords\CanResetPassword
which is a trait pulled in nowhere else, than your App\User
model.
So all you need to do is to create your own reset notification and override the sendPasswordResetNotification
method on your User
model, as shown below:
php artisan make:notification MyResetPasswordNotification
Edit app/Notifications/MyResetPasswordNotification.php
<?php
namespace App\Notifications;
use Illuminate\Notifications\Messages\MailMessage;
class MyResetPasswordNotification extends \Illuminate\Auth\Notifications\ResetPassword
{
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->line('You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', url('YOUR URL', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
}
Then add this to app/User.php
/**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new \App\Notifications\MyResetPasswordNotification($token));
}
Of course, you'll need to create your own route, as you wrote in the question and you'll have to change blade views too.