32 lines
582 B
PHP
32 lines
582 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
|
|
|
abstract class Departaimant extends BaseEnumRoutable
|
|
{
|
|
/**
|
|
* Output the value as a string
|
|
*
|
|
* @return string
|
|
*/
|
|
public function __toString(): string
|
|
{
|
|
return (string)$this->label;
|
|
}
|
|
|
|
/**
|
|
* Get All departaimants
|
|
*
|
|
* @return array<Departaimant>
|
|
*/
|
|
public static function all(): array
|
|
{
|
|
$o = [];
|
|
foreach (static::toArray() as $value => $label) {
|
|
$o[] = static::make($value);
|
|
}
|
|
return $o;
|
|
}
|
|
}
|