PHP code example of michielkempen / laravel-enum
1. Go to this page and download the library: Download michielkempen/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/ */
michielkempen / laravel-enum example snippets
use MichielKempen\LaravelEnum\Enum;
class ExampleEnum extends Enum
{
const TYPE_A = 'a';
const TYPE_B = 'b';
const TYPE_C = 'c';
}
ExampleEnum::TYPE_A; // outputs 'a'
ExampleEnum::TYPE_B; // outputs 'b'
ExampleEnum::all(); // outputs ['a', 'b', 'c']