ContactUs   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 29
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A __construct() 0 5 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
class ContactUs extends Mailable
10
{
11
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\ContactUs: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
12
13
    public string $mailFrom;
14
15
    public string $mailBody;
16
17
    public string $mailTo;
18
19
    /**
20
     * Create a new message instance.
21
     */
22
    public function __construct($mailTo, $mailFrom, $mailBody)
23
    {
24
        $this->mailTo = $mailTo;
25
        $this->mailFrom = $mailFrom;
26
        $this->mailBody = $mailBody;
27
    }
28
29
    /**
30
     * Build the message.
31
     *
32
     *
33
     * @throws \Exception
34
     */
35
    public function build(): static
36
    {
37
        return $this->from($this->mailTo)->subject('Contact form submitted')->replyTo($this->mailFrom)->view('emails.contactUs')->with(['mailBody' => $this->mailBody]);
38
    }
39
}
40