Add notification action foundation
This commit is contained in:
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user