nang cap san sang import
This commit is contained in:
28
app/Enums/ContractStatus.php
Normal file
28
app/Enums/ContractStatus.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ContractStatus: string
|
||||
{
|
||||
case ACTIVE = 'active';
|
||||
case EXPIRED = 'expired';
|
||||
case LIQUIDATED = 'liquidated';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::ACTIVE => 'Đang hiệu lực',
|
||||
self::EXPIRED => 'Hết hạn',
|
||||
self::LIQUIDATED => 'Đã thanh lý',
|
||||
};
|
||||
}
|
||||
|
||||
public function options(): array
|
||||
{
|
||||
return [
|
||||
self::ACTIVE->value => self::ACTIVE->label(),
|
||||
self::EXPIRED->value => self::EXPIRED->label(),
|
||||
self::LIQUIDATED->value => self::LIQUIDATED->label(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user