CheerfulNotification::getByKey('enum.news_status.draft'), self::PUBLISHED => CheerfulNotification::getByKey('enum.news_status.published'), self::ARCHIVED => CheerfulNotification::getByKey('enum.news_status.archived'), }; } public function getColor(): string|array|null { return match ($this) { self::DRAFT => 'warning', self::PUBLISHED => 'success', self::ARCHIVED => 'gray', }; } public static function options(): array { return collect(self::cases()) ->mapWithKeys(fn ($case) => [$case->value => $case->getLabel()]) ->toArray(); } }