honeybadger-io/honeybadger-laravel

View on GitHub
src/Events/NotificationEvent.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Honeybadger\HoneybadgerLaravel\Events;

use Illuminate\Notifications\Events\NotificationFailed;
use Illuminate\Notifications\Events\NotificationSending;
use Illuminate\Notifications\Events\NotificationSent;

abstract class NotificationEvent extends ApplicationEvent
{
    protected function getMetadata(NotificationSent|NotificationSending|NotificationFailed $event): array
    {
        return [
            'notification' => get_class($event->notification),
            'channel' => $event->channel,
            'queue' => $event->queue,
            'notifiable' => get_class($event->notifiable),
        ];
    }
}