1, 'estimateTodo' => 2, 'estimateValidated' => 3, 'toPlan' => 4, 'planned' => 5, 'inprogress' => 7, 'waiting' => 9, 'processed' => 10, 'recette' => 12, 'production' => 13, 'archived' => 15, 'estimateDone' => 16, 'waitingValidation' => 17, ]; } /** * Enum labels * * @return array */ protected static function labels(): array { return [ 'new' => trans('Nouveau'), 'estimateTodo' => trans('Devis à faire'), 'estimateValidated' => trans('Devis validé'), 'estimateDone' => trans('Devis réalisé'), 'toPlan' => trans('À planifier'), 'planned' => trans('Planifié'), 'inprogress' => trans('En cours'), 'waiting' => trans('En attente'), 'waitingValidation' => trans('En attente validation'), 'processed' => trans('Traité'), 'recette' => trans('En recettage'), 'production' => trans('En production'), 'archived' => trans('Archivé'), ]; } /** * Enum classes * * @return array */ protected static function classes(): array { return [ 'new' => 'text-danger', 'estimateTodo' => 'text-info', 'estimateValidated' => 'text-info', 'estimateDone' => 'text-info', 'toPlan' => 'text-info', 'planned' => 'text-info', 'inprogress' => 'text-dark', 'waiting' => 'text-white bg-danger', 'waitingValidation' => 'text-warning bg-danger', 'processed' => trans('Traité'), 'recette' => 'text-primary', 'production' => 'text-success', 'archived' => 'text-secondary', ]; } /** * @param string $attribute * @return integer|string */ public function __get(string $attribute) { if ($attribute === 'class') { return $this->classes()[$this->getDefinition()]; } return parent::__get($attribute); } }