Reputation: 3620
I create a model and save it, using the save() methods, and I do not fill all properties. Mysql will set the assigned default values of the columns.
But the values are not filled after, just the primary keys.
Isn't there a something like "refresh()" method which updates my model instance with the actual data?
Upvotes: 2
Views: 3932
Reputation: 220066
fresh
method on the model that does exactly that.$attributes
array so that you always have the default values automatically.Upvotes: 3