user = User::query()->where('id', $userId)->first(); $this->invite = $invite; } /** * Build the message. * * @return $this * @throws \Exception */ public function build() { return $this->from(Settings::settingValue('site.main.email'))->subject('Invite received')->view('emails.sendinvite')->with(['invite' => $this->invite, 'username' => $this->user->username, 'site' => Settings::settingValue('site.main.title'), 'email' => $this->user->email]); } }