25 lines
497 B
PHP
25 lines
497 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum RoleEnum: int
|
|
{
|
|
case ADMIN = 1;
|
|
case DISPATCHER = 2;
|
|
case DRIVER = 3;
|
|
|
|
public static function getRange()
|
|
{
|
|
return [RoleEnum::ADMIN, RoleEnum::DISPATCHER, RoleEnum::DRIVER];
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return match ($this){
|
|
self::ADMIN => 'Администратор',
|
|
self::DISPATCHER => 'Диспетчер',
|
|
self::DRIVER => 'Водитель'
|
|
};
|
|
}
|
|
}
|