-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement field option to set as nullable for create input type #86
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #86 +/- ##
============================================
+ Coverage 84.39% 84.43% +0.04%
- Complexity 647 649 +2
============================================
Files 75 75
Lines 1878 1883 +5
============================================
+ Hits 1585 1590 +5
Misses 293 293
Continue to review full report at Codecov.
|
@@ -49,8 +49,8 @@ protected function getFillableFields(): Collection | |||
$fields = parent::getFillableFields(); | |||
$defaults = $this->model->getAttributes(); | |||
|
|||
return $fields->map(function (Field $field, $key) use ($defaults) { | |||
if (in_array($key, array_keys($defaults))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still be there. nullableOnCreate
should just be an addition for more complex use cases where the default will be set by an observer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. 👍
Fixes #78