document = $document; } /** * 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) ->subject('Nueva versión de documento: ' . $this->document->name) ->line('Se ha subido una nueva versión del documento.') ->action('Ver Documento', route('documents.show', $this->document)) ->line('Gracias por usar nuestro sistema!'); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ 'document_id' => $this->document->id, 'message' => 'Nueva versión del documento: ' . $this->document->name, 'url' => route('documents.show', $this->document) ]; } }