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));
}
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community