Skip to content

Instantly share code, notes, and snippets.

@mhmohon
Created April 26, 2019 11:55
Show Gist options
  • Save mhmohon/bb3d23311d1d16a6c23b341e7bb671c4 to your computer and use it in GitHub Desktop.
Save mhmohon/bb3d23311d1d16a6c23b341e7bb671c4 to your computer and use it in GitHub Desktop.
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Mail;
use App\Mail\SendPasswordResetLink;
class SendPasswordResetEmail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $user;
protected $token;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($user, $token)
{
$this->user = $user;
$this->token = $token;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$email = $this->user->email;
$token = $this->token;
Mail::to($email)->send(new SendPasswordResetLink($this->user, $token));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment