color(); $background = Admin::color()->get($color, $color); return ' '.$this->text() ?? 'Unknown'; } public function text() { return static::options()[$this->value] ?? 'Unknown'; } public function color() { return match ($this) { static::Pending => 'primary', static::Paid => 'success', static::Revoked => '#b3b9bf', default => 'warning', }; } public static function options(): array { return [ self::Pending->value => '待付款', self::Paid->value => '已付款', self::Revoked->value => '已取消', ]; } }