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,對不起,不能刪除的問題 –