You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
446 B

<?php
namespace App\Domains\Account\Enums;
enum GenderOption: string
{
case MALE = 'male';
case FEMALE = 'female';
public function label(): string
{
return __("domains/account/enum.gender.{$this->value}");
}
public static function fromLabel($value): self
{
return match ($value) {
self::MALE->label() => self::MALE,
self::FEMALE->label() => self::FEMALE,
};
}
}