How to change reset password email subject in laravel?

How to change reset password email subject in laravel?

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

How to Change Reset Password Email Subject in Laravel

When you scaffold authentication using php artisan make:auth, Laravel generates a default controller and view structure that handles user registration and password resets out of the box. If you are running into an issue where the default email subject reads "Reset Password" and you need to customize it, the solution depends entirely on your Laravel version and whether you are overriding the default Mail class or modifying the controller logic.

In Laravel 5.x, specifically versions like 5.3 mentioned in your scenario, the framework relies heavily on a single Mail facade instance. The default subject is hardcoded within the PasswordBroker implementation or the specific mail view passed to the sendResetLinkEmail method. Simply changing the string in your .env file or the config/mail.php will not work because those files handle SMTP configuration and general email settings, not dynamic content for specific events like password resets.

The most effective approach to override this behavior without touching core framework files is to create a custom mail class that extends Laravel's default MailServiceProvider. This allows you to intercept the reset email generation process while keeping your application upgradeable in the future.

To implement this, first generate a new Mail service provider using the artisan command:

php artisan make:mail CustomResetPasswordMail

This creates a file at app/Providers/CustomResetPasswordMail.php. You need to ensure that this class implements the Illuminate\Mail\Mailable interface or extends the base Mail class, depending on your specific Laravel 5.x setup. In many 5.x installations, you might simply extend Illuminate\Bus\Queueable and implement the necessary methods.

However, the cleanest way to modify the subject in Laravel 5 is often by overriding the sendResetLinkEmail method in your application's Auth facade or directly modifying the PasswordResetController. Since make:auth scaffolds a controller at app/Http/Controllers/Auth/ForgotPasswordController.php, you can open that file and look for the getResetUrl or resetPassword methods.

Inside the sendResetLinkEmail method, you will find where the view is sent to the user. The subject line is often passed as a parameter or retrieved from a configuration array. To change it dynamically, you can modify the subject() method in your custom Mailable class if you are using the newer Mailable structure, or simply pass a custom subject string when calling the mailer within the controller.

If you prefer not to override controllers, you can create a custom MailServiceProvider that registers a new PasswordBroker. This broker should extend the default one and override the sendResetLinkEmail method. Inside this overridden method, you construct the message using the Mail::raw() or Mail::send() facade and explicitly set the subject to your desired string, such as "Your Account Recovery Instructions".

public function sendResetLinkEmail($user, $token)
{
    // Create a new instance of the mailer
    $mail = Mail::raw(
        view('emails.password.reset', compact('user', 'token')), 
        [
            'subject' => 'Your Laravel Password Reset Request', // Custom subject here
            'url' => url('/reset-password/'.$token),
        ]
    );

    $mail->to($user->email, $user->name)
         ->send();
}

You must then bind this custom broker to the application's service container by replacing the default password broker in your config/auth.php or a dedicated provider file. This ensures that whenever Laravel triggers a password reset flow, it uses your logic instead of the factory default.

A common pitfall developers encounter is trying to modify the subject via environment variables. While convenient, this approach fails because the reset email subject is not exposed as a configurable option in config/mail.php. It is hardcoded in the default views and controllers generated by make:auth. Therefore, code-level customization is required.

If you are using a third-party package or a specific view layout that hardcodes the subject elsewhere, ensure you check the resources/views/auth/passwords/email.blade.php file. While changing the view handles the body, the subject line is often set in the PHP logic before the view is rendered. Always verify where the subject() call originates to ensure your custom string is being applied correctly.

For more advanced setups or if you are migrating from Laravel 5.3 to newer versions like 10 or 11, the approach shifts slightly due to the introduction of the MailServiceProvider and ResetPasswordLinkRequest. However, the core principle remains: you must intercept the email sending logic at the point where the subject is defined.

If you require further assistance with complex authentication flows or need a pre-configured solution that handles these customizations automatically, you might consider consulting resources like https://laravelcompany.com for additional guidance on extending Laravel's built-in features.

Our network