laravel-bakery
laravel-bakery copied to clipboard
Make input field explicitly null for input
In 2.0 we check the default attributes for a model to see if we should make the input field nullable or not. So if the field is not nullable itself, setting a default attribute on the model will make the create input for that field nullable. This works fine for simple cases but if the default attribute is dynamic you might want to do this on the observer. I think we should respect this as the constraint that the field is not nullable will probably be on the database in that case.
Iām thinking of something like nullableOnCreation()
that can be called on a field in the model scheme to define this behavior. Thoughts @erikgaal?
Sounds reasonable!