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

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -