this is in a trait?
you can overload it in your own controller by duplicating the function with exactly the same name
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi.
It's possible or how to, convert class Illuminate/AuthNotifications/ResetPassword.php into localizable class?
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('password/reset', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
if made any changes on this file (->line(trans('some.file.array.value')), when change lost.
In your User model:
use App\Notifications\ResetPassword;
/**
* Send the password reset notification.
*
* @param string $token
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPassword($token, $this->username()));
}
Then make your own ResetPassword notification class:
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPassword extends Notification
{
/**
* The password reset token.
*
* @var string
*/
public $token;
/**
* Username for user.
*
* @var string
*/
public $username;
/**
* Create a notification instance.
*
* @param string $token
* @return void
*/
public function __construct($token, $username)
{
$this->token = $token;
$this->username = $username;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->from('[email protected]', 'AppName')
->subject(trans('general.reset_password_subject'))
->greeting(trans('general.reset_password_greeting', ['username' => $this->username]))
->line(trans('general.reset_password_line1'))
->action(trans('general.reset_password'), url('password/reset', $this->token))
->line(trans('general.reset_password_line2'));
}
}
Please or to participate in this conversation.