39 lines
772 B
PHP
39 lines
772 B
PHP
<?php
|
|
|
|
namespace App\Enums\Block;
|
|
|
|
use App\Traits\Enums\BaseEnum;
|
|
|
|
enum BlockPositionEnum: string
|
|
{
|
|
use BaseEnum;
|
|
|
|
case Gauche = 'gauche';
|
|
case Centre = 'centre';
|
|
case Droite = 'droite';
|
|
|
|
public const LABELS = [
|
|
'Gauche' => 'Gauche',
|
|
'Centre' => 'Centre',
|
|
'Droite' => 'Droite',
|
|
];
|
|
|
|
public static function options(): array
|
|
{
|
|
return self::all();
|
|
}
|
|
|
|
public static function validationRule(): string
|
|
{
|
|
return 'required|in:' . implode(',', array_column(self::cases(), 'value'));
|
|
}
|
|
|
|
public function toBootstrap(): string
|
|
{
|
|
return match ($this) {
|
|
self::Gauche => 'start',
|
|
self::Centre => 'center',
|
|
self::Droite => 'end',
|
|
};
|
|
}
|
|
}
|