Implement HasLabel interface in multiple enum classes, refactor label methods to improve localization consistency, and update default phone configuration in HR settings. Enhance employee form with phone number formatting and localization tests for enum options.
This commit is contained in:
@@ -4,7 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum DocumentType: string
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
|
||||
enum DocumentType: string implements HasLabel
|
||||
{
|
||||
case Passport = 'passport';
|
||||
case Contract = 'contract';
|
||||
@@ -12,7 +14,7 @@ enum DocumentType: string
|
||||
case EducationCertificate = 'education_certificate';
|
||||
case Other = 'other';
|
||||
|
||||
public function label(): string
|
||||
public function getLabel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Passport => __('enums.document_type.passport'),
|
||||
@@ -23,6 +25,11 @@ enum DocumentType: string
|
||||
};
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return $this->getLabel();
|
||||
}
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
|
||||
Reference in New Issue
Block a user