update os group

This commit is contained in:
pbao9
2026-02-02 09:07:33 +07:00
parent b3ad727d55
commit af71413a69
9 changed files with 182 additions and 106 deletions
+33
View File
@@ -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(),
];
}
}