0
是否有任何理由能言善辩$casts
wouldnt工作?Laravel JSON数组铸造
我存储JSON,JSON列类型,并
protected $casts = [
'fields' => 'array'
];
但是...
仍返回JSON
"{"first_name":"Brian","last_name":"Dillingham","email":"[email protected]"}"
当我变异
甚至不工作public function getFieldsAttribute($value)
{
return json_decode($value, true);
}
但工作的时候我
dd(json_decode(\App\Lead::find(1)->fields, true));
我认为它,因为我手动存储在文本字段的JSON,对不起,不能删除的问题 –