1. Go to this page and download the library: Download epalshin/enum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Palshin\Enum\Enum;
/**
* @method static self CLIENT()
* @method static self MANAGER()
* @method static self ADMIN()
*/
class UserRole extends Enum
{
public static function labels(): array
{
return [
'CLIENT' => 'Client account',
'MANAGER' => 'Manager account',
'ADMIN' => 'Administrator account'
];
}
public static function descriptions(): array
{
return [
'CLIENT' => 'Online store buyer',
'MANAGER' => 'The person who is responsible for interaction with the client',
'ADMIN' => 'The person who controls the managers'
];
}
}
UserRole::CLIENT()->label; // Client account
UserRole::MANAGER()->description; // The person who is responsible for interaction with the client
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.