I am trying to fill an Eloquent model with attributes from user request. The fillable array is properly set. However, some of these attributes do not have the corresponding database column. I would like the model's save() method to ignore these attributes when saving.
I found the magic accessors (http://laravel.com/docs/eloquent#accessors-and-mutators) that let you add non-persistent attributes. However, the save() would still include them in the insert query if that attribute(s) is in the fillable array.
The only solution appear to be unsetting the non-persistent attributes (that are in the fillable array) on saving() event of the model. Any other solution better than using the saving() event?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community