diff --git a/app/Listeners/ReportEventSubscriber.php b/app/Listeners/ReportEventSubscriber.php new file mode 100644 index 00000000..c526f81d --- /dev/null +++ b/app/Listeners/ReportEventSubscriber.php @@ -0,0 +1,41 @@ +report->user_id); + $ReportOwner->notify(new ReportStatusChangedNotification($event)); + } + + public function subscribe(Dispatcher $events): array + { + return [ + ReportStatusChanged::class => 'handleReportStatusChanged', + ]; + } +} diff --git a/app/Notifications/ReportStatusChangedNotification.php b/app/Notifications/ReportStatusChangedNotification.php new file mode 100644 index 00000000..7539c32e --- /dev/null +++ b/app/Notifications/ReportStatusChangedNotification.php @@ -0,0 +1,54 @@ + + */ + public function via(object $notifiable): array + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + */ + public function toMail(object $notifiable): MailMessage + { + return (new MailMessage) + ->line('The introduction to the notification.') + ->action('Notification Action', url('/')) + ->line('Thank you for using our application!'); + } + + /** + * Get the array representation of the notification. + * + * @return array + */ + public function toArray(object $notifiable): array + { + return [ + // + ]; + } +}