generated from liutk/owl-admin-base
31 lines
681 B
PHP
31 lines
681 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum PlanStatus: int
|
|
{
|
|
case Pending = 1;
|
|
case Published = 5;
|
|
|
|
public function text(): string
|
|
{
|
|
return self::options()[$this->value];
|
|
}
|
|
|
|
public static function options(): array
|
|
{
|
|
return [
|
|
self::Pending->value => '待发布',
|
|
self::Published->value => '已发布',
|
|
];
|
|
}
|
|
|
|
public static function labelMap(): array
|
|
{
|
|
return [
|
|
self::Pending->value => '<span class="label label-primary">'.self::Pending->text().'</span>',
|
|
self::Published->value => '<span class="label label-success">'.self::Published->text().'</span>',
|
|
];
|
|
}
|
|
}
|