1 | <?php |
||
2 | |||
3 | namespace App\Jobs; |
||
4 | |||
5 | use App\Mail\AccountExpired; |
||
6 | use App\Models\User; |
||
7 | use Illuminate\Bus\Queueable; |
||
8 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
9 | use Illuminate\Foundation\Bus\Dispatchable; |
||
10 | use Illuminate\Queue\InteractsWithQueue; |
||
11 | use Illuminate\Queue\SerializesModels; |
||
12 | use Illuminate\Support\Facades\Mail; |
||
13 | |||
14 | class SendAccountExpiredEmail implements ShouldQueue |
||
15 | { |
||
16 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
17 | |||
18 | /** |
||
19 | * @var User |
||
20 | */ |
||
21 | private $user; |
||
22 | |||
23 | /** |
||
24 | * Create a new job instance. |
||
25 | */ |
||
26 | public function __construct(User $user) |
||
27 | { |
||
28 | $this->user = $user; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Execute the job. |
||
33 | */ |
||
34 | public function handle(): void |
||
35 | { |
||
36 | Mail::to($this->user->email)->send(new AccountExpired($this->user)); |
||
37 | } |
||
38 | } |
||
39 |