PHP code example of splitstack / laravel-enum-friendly
1. Go to this page and download the library: Download splitstack/laravel-enum-friendly 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/ */
splitstack / laravel-enum-friendly example snippets
use Splitstack\EnumFriendly\Traits\ExtendedEnum;
enum Status: string
{
use ExtendedEnum;
case ACTIVE = 'active';
case INACTIVE = 'inactive';
}
use Splitstack\EnumFriendly\Traits\ExtendedEnum;
enum MyEnum: string
{
use ExtendedEnum;
case ADMIN = 'admin';
case USER = 'user';
}