You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It isn't
Describe the solution you'd like
When defining a new model, the developer should have the option to define default values on the model. These defaults are sent to the server when saving the model so they should not be included in the original object when checking for changes
Describe how this would benefit the project/others
It would save the developer from having to pass in default values on constructing
Describe alternatives you've considered
none
Is there a currently a way to achieve this?
factories
custom user built method
an accessor
a custom caster
Additional context
Perhaps setting the attributes on the class definitely like public myAttribute = 1 would be the most intuitive given the current typing uses these attributes when set. This might be achieved by getting all the custom properties on the model which doesn't have getter and setter defined but a value.
Questions
Should these default values be passed to the accessors and should they be cast?
How should these default values be defined?
The text was updated successfully, but these errors were encountered:
Search terms
attributes
default value
Is your feature request related to a problem? Please describe.
It isn't
Describe the solution you'd like
When defining a new model, the developer should have the option to define default values on the model. These defaults are sent to the server when saving the model so they should not be included in the
original
object when checking for changesDescribe how this would benefit the project/others
It would save the developer from having to pass in default values on constructing
Describe alternatives you've considered
none
Is there a currently a way to achieve this?
Additional context
Perhaps setting the attributes on the class definitely like
public myAttribute = 1
would be the most intuitive given the current typing uses these attributes when set. This might be achieved by getting all the custom properties on the model which doesn't have getter and setter defined but a value.Questions
The text was updated successfully, but these errors were encountered: