base commit
This commit is contained in:
39
app/Enums/Gender.php
Normal file
39
app/Enums/Gender.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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 => 'Male',
|
||||
self::Female => 'Female',
|
||||
self::Other => '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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user