ldc-loue/app/Enums/PublishedStatus.php
Jérémy Munsch 0751114f4a
BO News, Tags, Sliders
CKeditor + word counter + Image Input + Taggable VUE3
Better Xss Sanitizer
Handle Video Youtube + Image Upload + Inline Image from url
Better Image Input component with reset, easizer resize
Full Responsive BO
2022-06-04 15:55:36 +02:00

67 lines
1.3 KiB
PHP

<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self draft()
* @method static self published()
* @method static self archived()
*/
final class PublishedStatus extends BaseEnum
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'draft' => 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' => '&#128221;',
'published' => '&#127757;',
'archived' => '&#128452;&#65039;'
];
}
/**
* @param string $attribute
* @return integer|string
*/
public function __get(string $attribute)
{
if ($attribute === 'icon') {
return $this->icon()[$this->getDefinition()] ?? null;
}
return parent::__get($attribute);
}
}