0, 'published' => 1, 'archived' => 2 ]; } /** * Enum labels * * @return array */ protected static function labels(): array { return [ 'draft' => trans('enums.draft'), 'published' => trans('enums.published'), 'archived' => trans('enums.archived') ]; } /** * Enum classes * * @return array */ protected static function icon(): array { return [ 'draft' => '📝', 'published' => '🌍', 'archived' => '🗄️' ]; } /** * @param string $attribute * @return integer|string */ public function __get(string $attribute) { if ($attribute === 'icon') { return $this->icon()[$this->getDefinition()] ?? null; } return parent::__get($attribute); } }