Add notification action foundation

This commit is contained in:
Eric Peters
2026-04-20 21:59:57 +02:00
parent 8df9622f1b
commit e4762f8e32
22 changed files with 1047 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Enums;
enum NotificationChannel: string
{
case Discord = 'discord';
case Webhook = 'webhook';
public function label(): string
{
return match ($this) {
self::Discord => 'Discord',
self::Webhook => 'Webhook',
};
}
/**
* @return array<int, array{label: string, value: string}>
*/
public static function options(): array
{
return array_map(
fn (self $channel): array => [
'label' => $channel->label(),
'value' => $channel->value,
],
self::cases(),
);
}
}