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,14 +4,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum BonusType: string
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
|
||||
enum BonusType: string implements HasLabel
|
||||
{
|
||||
case Performance = 'performance';
|
||||
case Holiday = 'holiday';
|
||||
case Retention = 'retention';
|
||||
case Other = 'other';
|
||||
|
||||
public function label(): string
|
||||
public function getLabel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Performance => __('enums.bonus_type.performance'),
|
||||
@@ -21,6 +23,11 @@ enum BonusType: string
|
||||
};
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return $this->getLabel();
|
||||
}
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
|
||||
Reference in New Issue
Block a user