parfum/app/Enums/EmploymentStatus.php

34 lines
683 B
PHP

<?php
namespace App\Enums;
enum EmploymentStatus: int
{
case PERMANENT = 1;
case CONTRACT = 2;
case INTERN = 3;
public function label(): string
{
return match ($this) {
self::PERMANENT => 'Permanent',
self::CONTRACT => 'Contract',
self::INTERN => 'Intern',
};
}
public function color(): string
{
return match ($this) {
self::PERMANENT => 'primary',
self::CONTRACT => 'warning',
self::INTERN => 'secondary',
};
}
public static function values(): array
{
return array_map(fn ($case) => $case->value, self::cases());
}
}