Created
April 26, 2019 11:55
-
-
Save mhmohon/bb3d23311d1d16a6c23b341e7bb671c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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