PHP code example of jn-jairo / laravel-eloquent-cast
1. Go to this page and download the library: Download jn-jairo/laravel-eloquent-cast 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/ */
jn-jairo / laravel-eloquent-cast example snippets
namespace App;
use Illuminate\Database\Eloquent\Model;
use JnJairo\Laravel\EloquentCast\HasAttributesCast;
class Foo extends Model
{
use HasAttributesCast;
protected $casts = [
'uuid' => 'uuid',
'is_admin' => 'boolean',
'created_at' => 'datetime:Y-m-d H:i:s',
];
}