40 lines
832 B
PHP
40 lines
832 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
enum Gender: string
|
|
{
|
|
case Male = 'male';
|
|
case Female = 'female';
|
|
case Other = 'other';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Male => __('enums.gender.male'),
|
|
self::Female => __('enums.gender.female'),
|
|
self::Other => __('enums.gender.other'),
|
|
};
|
|
}
|
|
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
self::Male => 'info',
|
|
self::Female => 'pink',
|
|
self::Other => 'gray',
|
|
};
|
|
}
|
|
|
|
public function icon(): string
|
|
{
|
|
return match ($this) {
|
|
self::Male => 'heroicon-o-user',
|
|
self::Female => 'heroicon-o-user',
|
|
self::Other => 'heroicon-o-users',
|
|
};
|
|
}
|
|
}
|