SendMail   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use Illuminate\Queue\SerializesModels;
8
9
/**
10
 * Class SendMail
11
 *
12
 * @package App\Mail
13
 */
14
class SendMail extends Mailable
15
{
16
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\SendMail: $id, $relations, $class, $keyBy
Loading history...
17
18
    /**
19
     * SendMail constructor.
20
     *
21
     * @param $to
22
     * @param  string  $subject
23
     * @param  string  $blade
24
     * @param  array  $data
25
     */
26
    public function __construct($to, string $subject, string $blade, array $data)
27
    {
28
        $this->to($to)
29
             ->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'))
30
             ->subject($subject)
31
             ->view($blade)
32
             ->with($data);
33
    }
34
35
    /**
36
     * Build the message.
37
     *
38
     * @return $this
39
     */
40
    public function build()
41
    {
42
        return $this;
43
    }
44
}
45