1. Go to this page and download the library: Download desmart/laravel-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/ */
desmart / laravel-enum example snippets
class Character extends DeSmart\Laravel\Enumeration
{
const GOOD = 'good';
const EVIL = 'evil';
const SOMETIMES_GOOD_SOMETIMES_EVIL = 'sometimes_good_sometimes_evil';
}
class Hero extends Model
{
/**
* @var array
*/
protected $casts = [
'character' => Character::class,
];
}