mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
28 lines
552 B
PHP
28 lines
552 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
use Illuminate\Support\Str;
|
|
|
|
enum RoleEnum: string implements HasColor, HasLabel
|
|
{
|
|
case Admin = 'admin';
|
|
case User = 'user';
|
|
|
|
public function getColor(): string|array|null
|
|
{
|
|
return [
|
|
'admin' => 'primary',
|
|
'user' => 'secondary',
|
|
];
|
|
}
|
|
|
|
public function getLabel(): string|Htmlable|null
|
|
{
|
|
return Str::of($this->name);
|
|
}
|
|
}
|