is there any reason eloquent $casts wouldnt be working?
I am storing json, json column type, and
protected $casts = [
'fields' => 'array'
];
But..
\App\Lead::find(1)->fields
still returns json
"{"first_name":"Brian","last_name":"Dillingham","email":"[email protected]"}"
Doesn't even work when I mutate
public function getFieldsAttribute($value)
{
return json_decode($value, true);
}
But works when I
dd(json_decode(\App\Lead::find(1)->fields, true));