php - Get Calculated Field from Eloquent only when it was declared -
i'm working eloquent , laravel 5, added field @ $appends attribute on model , mutator value. issue is, how field when called?
public static $model = 'model'; protected $table = 'table'; protected $primarykey = 'idtable'; public $incrementing = false; public $timestamps = false; protected $appends = ['desccomposta']; //mutators public function getdesccompostaattribute() { return $this->attributes['desc_composta'] = 'yes'; } thank all!
Comments
Post a Comment