PHP code example of morrislaptop / laravel-popo-caster
1. Go to this page and download the library: Download morrislaptop/laravel-popo-caster 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/ */
morrislaptop / laravel-popo-caster example snippets
namespace App\Models;
use App\Values\Address;
use Illuminate\Database\Eloquent\Model;
use Morrislaptop\LaravelPopoCaster\Serializer;
/**
* @property Address $address
*/
class User extends Model
{
protected $casts = [
'address' => Serializer::class . ':' . Address::class,
'prev_addresses' => Serializer::class . ':' . Address::class . '[]',
];
}