1. Go to this page and download the library: Download lazerg/laravel-enum-pro 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/ */
lazerg / laravel-enum-pro example snippets
enum LevelTypes: int
{
use \Lazerg\LaravelEnumPro\EnumPro;
case VERY_EASY = 1;
case EASY = 2;
case MEDIUM = 3;
case STRONG = 4;
case VERY_STRONG = 5;
}
LevelTypes::random(); // Collection with one random value
LevelTypes::randomArray(); // Array with one random value
LevelTypes::randomFirst(); // Single random value
LevelTypes::options(); // Collection of [value => display]
LevelTypes::optionsToArray();
LevelTypes::selections(); // Collection of [value => ..., display => ...]
LevelTypes::selectionsToArray();