for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Mail;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class AccountChange extends Mailable
{
use Queueable, SerializesModels;
Illuminate\Queue\SerializesModels
App\Mail\AccountChange
$collectionClass
$id
$relations
$class
$keyBy
/**
* @var User
*/
public $user;
* @var mixed
private $siteEmail;
private $siteTitle;
* AccountChange constructor.
public function __construct(User $user)
$this->user = $user;
$this->siteEmail = config('mail.from.address');
$this->siteTitle = config('app.name');
}
* Build the message.
*
* @throws \Exception
public function build(): static
return $this->from($this->siteEmail)->subject('Account Changed')->view('emails.accountChange')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle]);