I am stumped by this one. I want to add a json encoded array to the data which is being passed to my model.
In my model I have a mutator which will perform some custom work on the array before submission.
However even though I am certain that the data exists in the $data array, when I Log the value in the model I get nothing back. Any ideas are appreciated.
MyRepository.php
$data['additionalAttributes'] = json_encode($additionalAttributes);
Log::debug($data);
return MyModel::create($data);
MyModel.php
public function setAdditionalAttributesAttribute($value) {
Log::debug($this->additionalAttributes);
}
additionalAttributes has been set in the fillable property also. All of the other attributes are loggable except this one? Any ideas on why this is the case?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1O2NVX3
via IFTTT
Aucun commentaire:
Enregistrer un commentaire