Support the ongoing development of Laravel.io →
Authentication Breeze Laravel

hi why the password reset link has changed to localhost/token while it suppose to be localhost:8000/token

i have created a job to handle the process of sending an reset-password link to the user and below the code when i used it in the method sendPasswordResetNotification() in the user model the link send to user is localhost/token not localhost:8000

<?php

namespace App\Jobs;

use App\Models\User;
use App\Notifications\SendPasswordResetNotification;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class ProcessPasswordResetEmail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;


    public User $user;

    protected string  $token;
    /**
     * Create a new job instance.
     */
    public function __construct(User $user , string $token)
    {

        $this->token = $token;

        $this->user = $user;

        $this->onQueue('email');
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        $this->user->notify(new SendPasswordResetNotification($this->token));
    }
}

  public function sendPasswordResetNotification($token)
    {

        ProcessPasswordResetEmail::dispatch($this,$token);

        //$this->notify(new SendPasswordResetNotification($token));
    }
Last updated by @mina20088 1 year ago.
0
moderator Solution

Hello @mina20088

Can you check the setting in your .env file for APP_URL? I suspect you have there APP_URL=http://localhost and not APP_URL=http://localhost:8000

abhigandhiabc liked this reply

1
Solution selected by @mina20088

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.