update os group
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum Status: int
|
||||
{
|
||||
case DEACTIVE = 0;
|
||||
case ACTIVE = 1;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::DEACTIVE => 'Không hoạt động',
|
||||
self::ACTIVE => 'Hoạt động',
|
||||
};
|
||||
}
|
||||
|
||||
public function badge(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::DEACTIVE => '<span class="badge badge-danger">Không hoạt động</span>',
|
||||
self::ACTIVE => '<span class="badge badge-success">Hoạt động</span>',
|
||||
};
|
||||
}
|
||||
|
||||
public static function getOptions(): array
|
||||
{
|
||||
return [
|
||||
self::DEACTIVE->value => self::DEACTIVE->label(),
|
||||
self::ACTIVE->value => self::ACTIVE->label(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user