Complete the code to send a mail using a Mailable class.
Mail::to($user->email)->[1](new WelcomeMail());The send method sends the mail immediately using the specified Mailable class.
Complete the code to define the subject of the mail in the Mailable class.
public function build()
{
return $this->view('emails.welcome')->[1]('Welcome to our site');
}The subject method sets the subject line of the email.
Fix the error in the Blade mail template to display the user's name safely.
<p>Hello, [1]</p>Using {{ $user->name }} escapes the output to prevent security issues.
Fill both blanks to pass data to the mail view in the Mailable class.
public function build()
{
return $this->view('emails.notification')->with([1] => [2]);
}The with method passes data to the view as key-value pairs. The key is a string, and the value is the variable.
Fill all three blanks to create a Markdown mail with a custom greeting and action button.
public function build()
{
return $this->markdown('emails.reminder')
->[1]('Reminder')
->[2]('Hello, please check your tasks.')
->[3]('View Tasks', url('/tasks'));
}The subject sets the email subject, greeting sets a custom greeting line, and action adds a button with a label and URL.