PHP code example of brokeyourbike / enum-casts-laravel

1. Go to this page and download the library: Download brokeyourbike/enum-casts-laravel 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/ */

    

brokeyourbike / enum-casts-laravel example snippets


use Illuminate\Database\Eloquent\Model;
use BrokeYourBike\EnumCasts\EnumCast;
use BrokeYourBike\EnumCasts\NullableEnumCast;

class Order extends Model
{
    protected $casts = [
        'state' => EnumCast::class . ':' . StateEnum::class,
        'state_nullable' => NullableEnumCast::class . ':' . StateEnum::class,
    ];
}