27 lines
502 B
PHP
27 lines
502 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\Enum\WithComment;
|
|
use App\Traits\Enum\WithValue;
|
|
|
|
enum SalaryAdjustmentType: string
|
|
{
|
|
use WithComment, WithValue;
|
|
|
|
case BONUS = 'Bonus';
|
|
case DEDUCTION = 'Potongan';
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
public static function options(): array
|
|
{
|
|
return collect(self::cases())
|
|
->mapWithKeys(fn ($case) => [$case->value => $case->getLabel()])
|
|
->toArray();
|
|
}
|
|
}
|