30 lines
540 B
PHP
30 lines
540 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
|
|
|
/**
|
|
* This defines a data type.
|
|
*
|
|
* @method static self admin() admin role
|
|
* @method static self user() user role
|
|
*/
|
|
final class Roles extends BaseEnumRoutable
|
|
{
|
|
protected static function values(): array
|
|
{
|
|
return [
|
|
'admin' => 1,
|
|
'user' => 2,
|
|
];
|
|
}
|
|
|
|
protected static function labels(): array
|
|
{
|
|
return [
|
|
'admin' => 'Administrateur',
|
|
'user' => 'Utilisateur',
|
|
];
|
|
}
|
|
}
|