name => 'enums.width.half', self::full->name => 'enums.width.full', ]; /** * Custom percent width value */ private const PERCENTVALUE = [ self::half->name => '50 %', self::full->name => '100 %' ]; /** * Get percent width value * * @return string */ public function percentValue(): string { return self::PERCENTVALUE[$this->name]; } /** * Custom dimension validation for the enum */ private const DIMVALIDATION = [ self::half->name => [ 'width' => 600, 'height' => 500 ], self::full->name => [ 'width' => 1300, 'height' => 500 ], ]; /** * Get percent width value * * @return array */ public function dimValidation(): array { return self::DIMVALIDATION[$this->name]; } }