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

25 lines
482 B
PHP

<?php
namespace App\Enums;
enum StatusEnum: int
{
case CREATED = 1;
case SENT = 2;
case DELIVERED = 3;
public static function getRange()
{
return [StatusEnum::CREATED, StatusEnum::SENT, StatusEnum::DELIVERED];
}
public function description()
{
return match ($this){
self::CREATED => 'Создан',
self::SENT => 'Отправлен',
self::DELIVERED => 'Доставлен'
};
}
}