mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-24 19:08:53 +03:00
36 lines
776 B
PHP
36 lines
776 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use BackedEnum;
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasIcon;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
|
|
enum WebhookType: string implements HasColor, HasIcon, HasLabel
|
|
{
|
|
case Regular = 'regular';
|
|
case Discord = 'discord';
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return trans('admin/webhook.' . $this->value);
|
|
}
|
|
|
|
public function getColor(): ?string
|
|
{
|
|
return match ($this) {
|
|
self::Regular => null,
|
|
self::Discord => 'blurple',
|
|
};
|
|
}
|
|
|
|
public function getIcon(): BackedEnum
|
|
{
|
|
return match ($this) {
|
|
self::Regular => TablerIcon::WorldWww,
|
|
self::Discord => TablerIcon::BrandDiscord,
|
|
};
|
|
}
|
|
}
|