ORUploadedNotification.php
1 <?php 2 3 namespace App\Notifications; 4 5 use App\Models\Dossier; 6 use Illuminate\Bus\Queueable; 7 use Illuminate\Contracts\Queue\ShouldQueue; 8 use Illuminate\Notifications\Notification; 9 10 class ORUploadedNotification extends Notification implements ShouldQueue 11 { 12 use Queueable; 13 14 public function __construct(public Dossier $dossier) 15 { 16 // 17 } 18 19 public function via($notifiable): array 20 { 21 return ['database']; 22 } 23 24 public function toArray($notifiable): array 25 { 26 return [ 27 'user_id' => $notifiable->id, 28 'title' => __('notifications.message-title.ORUploadedNotification', [ 29 'dossierCode' => $this->dossier->code, 30 ]), 31 'message' => __('notifications.messages.ORUploadedNotification', [ 32 'dossierCode' => $this->dossier->code, 33 ]), 34 ]; 35 } 36 }