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

SendAccountWillExpireEmail   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 3 1
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