SUBD_Transport_Company/app/Enums/RoleEnum.php
2024-01-16 15:14:13 +04:00

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 => 'Водитель'
};
}
}