1 year ago

Model Save or Update Casts Object

Posted 1 year ago by bitcoinboy

I have an element casts to object:

//Inside a Model file:

    protected $casts = [
        'value' => 'object',

Ok now if I update it like this way it won't work:

$something = Something::first();
$something->value->any = 'any';

BTW I'm using laravel 5.5

Please sign in or create an account to participate in this conversation.