username = (string) $user->username; $this->account = (string) ($user->role->name ?? 'User'); $this->siteEmail = (string) config('mail.from.address'); $this->site = (string) config('app.name'); $this->preheader = "Your {$this->site} account level was updated to {$this->account}."; } /** * @throws \Exception */ public function build(): static { return $this->from($this->siteEmail) ->brandedSubject('Account level changed') ->markdown('emails.markdown.accountChange', [ 'username' => $this->username, 'account' => $this->account, 'site' => $this->site, 'preheader' => $this->preheader, ]); } }