SendMail::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 4
dl 0
loc 7
rs 10
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