toby/app/Enums/FormOfEmployment.php
Adrian Hopek acf2eba95d #4- wip
2022-01-18 07:39:03 +01:00

28 lines
651 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Enums;
enum FormOfEmployment: string
{
case EMPLOYMENT_CONTRACT = "employment_contract";
case COMMISSION_CONTRACT = "commission_contract";
case B2B_CONTRACT = "b2b_contract";
case BOARD_MEMBER_CONTRACT = "board_member_contract";
public function label(): string
{
return __($this->value);
}
public static function casesToSelect(): array
{
$cases = collect(FormOfEmployment::cases());
return $cases->map(fn(FormOfEmployment $enum) => [
"label" => $enum->label(),
"value" => $enum->value]
)->toArray();
}
}