Level 13
OMG check this out, i just add in the model:
protected $appends = array('attribute1', 'attribute2');
//then
public function getAttribute1Attribute($attribute1){
$attribute1 = ...... ;
return $attribute1;
}
Beautiful :)
3 likes
Is there a way to create an attribute on an Eloquent model that does not exists in its DB table? Say for example, to create composite columns' values with combined attributes!
OMG check this out, i just add in the model:
protected $appends = array('attribute1', 'attribute2');
//then
public function getAttribute1Attribute($attribute1){
$attribute1 = ...... ;
return $attribute1;
}
Beautiful :)
Please or to participate in this conversation.