xxxxxxxxxx
// just go to your desired model like User
class User extends Model{
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'names' => 'array',
]
}
xxxxxxxxxx
use Illuminate\Database\Eloquent\Casts\AsCollection;
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'options' => AsCollection::class,
];