message = $this->generateMessage(); } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return ['mail', 'database']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->view('emails.asameeting', [ 'headerImageUrl' => asset('images/AUTOHUB25_BANNER.png'), // URL of the image 'msg' => $this->message, 'notifiable' => $notifiable, ]) ->subject($this->asaMeeting->meeting_title); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { $user = Auth::user(); $fullname = $user->first_name . ' ' . $user->last_name; return [ 'asa_meeting_id' => $this->asaMeeting->id, 'message' => $this->message, 'title' => $fullname.' invited you for a meeting', 'url' => 'meeting-calendar/calendar', 'created_by' => $this->asaMeeting->employee_id ]; } /** * Generate the message based on leave status. */ private function generateMessage(): string { $user = Auth::user(); $fullname = $user->first_name . ' ' . $user->last_name; return $fullname.' invited you for a meeting on '.$this->asaMeeting->start_datetime.' to '.$this->asaMeeting->end_datetime.'.'; } }