Files
technical-services-exchange/app/Notifications/ExchangeEventNotification.php
T
2026-07-10 10:38:02 -05:00

48 lines
988 B
PHP

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
class ExchangeEventNotification extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(
public string $title,
public string $body,
public ?string $url = null,
public string $type = 'exchange_event',
) {
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['database'];
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
'type' => $this->type,
'title' => $this->title,
'body' => $this->body,
'url' => $this->url,
];
}
}