Add ticket status changed notification dispatch

This commit is contained in:
Eric Peters
2026-04-20 22:50:22 +02:00
parent ee15efe739
commit 71f07a8f7b
8 changed files with 417 additions and 0 deletions
@@ -0,0 +1,23 @@
<?php
namespace App\Actions\Notifications;
use App\Models\NotificationAction;
class QueueTicketStatusChangedNotificationDeliveries
{
public function handle(TicketStatusChanged $event): void
{
NotificationAction::query()
->enabled()
->where('project_id', $event->payload->projectId)
->where('event_type', $event->payload->eventType->value)
->get(['id'])
->each(function (NotificationAction $notificationAction) use ($event): void {
DeliverNotificationAction::dispatch(
$notificationAction->id,
$event->payload,
);
});
}
}