public function setPreferencesAttribute($value) { $this->attributes['preferences'] = json_encode($value); }