Completed
Push — dev ( 0a1751...897647 )
by Darko
07:52
created

SendAccountWillExpireEmail::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Jobs;
4
5
use Illuminate\Bus\Queueable;
6
use App\Mail\AccountWillExpire;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
use Illuminate\Support\Facades\Mail;
12
13
class SendAccountWillExpireEmail implements ShouldQueue
14
{
15
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\SendAccountWillExpireEmail: $id, $class, $relations
Loading history...
16
17
    private $days;
18
19
    private $user;
20
21
    /**
22
     * Create a new job instance.
23
     *
24
     * @return void
25
     */
26
    public function __construct($user, $days)
27
    {
28
        $this->user = $user;
29
        $this->days = $days;
30
    }
31
32
    /**
33
     * Execute the job.
34
     *
35
     * @return void
36
     */
37
    public function handle()
38
    {
39
        Mail::to($this->user->email)->send(new AccountWillExpire($this->user, $this->days));
40
    }
41
}
42