server->loadMissing('user'); $this->server = $event->server; $this->user = $event->server->user; $this->user->notifyNow($this); } /** * Get the notification's delivery channels. * * @return list */ public function via(): array { return ['mail']; } /** * Get the mail representation of the notification. */ public function toMail(): MailMessage { return (new MailMessage) ->subject(__('notifications.server_installed.subject')) ->greeting(__('notifications.server_installed.greeting', ['name' => $this->user->username])) ->line(__('notifications.server_installed.intro')) ->line(__('notifications.server_installed.server', ['server' => $this->server->name])) ->action(__('notifications.server_installed.action'), route('index')); } }