*/ public function via(object $notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { $team = $this->invitation->team; $inviter = $this->invitation->inviter; return (new MailMessage) ->subject(__("You've been invited to join :teamName", ['teamName' => $team->name])) ->line(__(':inviterName has invited you to join the :teamName team.', [ 'inviterName' => $inviter->name, 'teamName' => $team->name, ])) ->action(__('Accept invitation'), url("/invitations/{$this->invitation->code}/accept")); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ 'invitation_id' => $this->invitation->id, 'team_id' => $this->invitation->team_id, 'team_name' => $this->invitation->team->name, 'role' => $this->invitation->role->value, ]; } }