/ app / Notifications / ParticipantToMeetNotification.php
ParticipantToMeetNotification.php
 1  <?php
 2  
 3  namespace App\Notifications;
 4  
 5  use Illuminate\Bus\Queueable;
 6  use Illuminate\Contracts\Queue\ShouldQueue;
 7  use Illuminate\Notifications\Notification;
 8  
 9  class ParticipantToMeetNotification extends Notification
10  {
11      use Queueable;
12  
13      /**
14       * Create a new notification instance.
15       *
16       * @return void
17       */
18      public function __construct(public string $meetName)
19      {
20          //
21      }
22  
23      public function via($notifiable): array
24      {
25          return ['database'];
26      }
27  
28      /**
29       * Get the array representation of the notification.
30       *
31       * @param  mixed  $notifiable
32       * @return array
33       */
34      public function toArray($notifiable): array
35      {
36          return [
37              'user_id' => $notifiable->id,
38              'title' => __('notifications.message-title.ParticipantToMeetNotification'),
39              'message' => __('notifications.messages.ParticipantToMeetNotification', [
40                  'meetName' => $this->meetName,
41              ]),
42          ];
43      }
44  }