*/ public function via(object $notifiable): array { return ['database', 'mail']; } /** * @return array */ public function toDatabase(object $notifiable): array { return [ 'folder_id' => $this->folder->id, 'folder_title' => $this->folder->title, 'mentioned_by_id' => $this->mentionedBy->id, 'mentioned_by_name' => $this->mentionedBy->name, 'message' => $this->message, 'url' => route('folders.show', $this->folder), ]; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject('Vous avez été mentionné - '.$this->folder->title) ->markdown('emails.folder-mention', [ 'folderTitle' => $this->folder->title, 'mentionedByName' => $this->mentionedBy->name, 'message' => $this->message, 'url' => route('folders.show', $this->folder), ]); } }