Files
hr/app/Enums/EmploymentStatus.php

51 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Enums;
use Filament\Support\Contracts\HasLabel;
enum EmploymentStatus: string implements HasLabel
{
case Active = 'active';
case Inactive = 'inactive';
case Terminated = 'terminated';
case OnLeave = 'on_leave';
public function getLabel(): string
{
return match ($this) {
self::Active => __('enums.employment_status.active'),
self::Inactive => __('enums.employment_status.inactive'),
self::Terminated => __('enums.employment_status.terminated'),
self::OnLeave => __('enums.employment_status.on_leave'),
};
}
public function label(): string
{
return $this->getLabel();
}
public function color(): string
{
return match ($this) {
self::Active => 'success',
self::Inactive => 'gray',
self::Terminated => 'danger',
self::OnLeave => 'warning',
};
}
public function icon(): string
{
return match ($this) {
self::Active => 'heroicon-o-check-circle',
self::Inactive => 'heroicon-o-pause-circle',
self::Terminated => 'heroicon-o-x-circle',
self::OnLeave => 'heroicon-o-clock',
};
}
}