use App\Events\Invoice\InvoiceCreated;
use App\Events\Invoice\InvoicePaid;
use App\Events\Ticket\TicketCreated;
use App\Events\Ticket\TicketMessageCreated;
use App\Events\User\UserCreated;
use App\Helpers\ExtensionHelper;
class DiscordWebhookListeners
{
private function sendWebhook(string $title, string $message, array $fields = [], string $color = '00ff00'): void
{
// ...
}
public function handleInvoiceCreated(InvoiceCreated $event): void
{
// ...
}
public function handleInvoicePaid(InvoicePaid $event): void
{
// ...
}
public function newTicketMessage($event)
{
// ...
}
public function newUser($event)
{
// ...
}
public function newTicket($event)
{
// ...
}
// ...
public function subscribe(): array
{
return [
InvoiceCreated::class => 'handleInvoiceCreated',
InvoicePaid::class => 'handleInvoicePaid',
TicketMessageCreated::class => 'newTicketMessage',
UserCreated::class => 'newUser',
TicketCreated::class => 'newTicket',
];
}
}