-
Notifications
You must be signed in to change notification settings - Fork 288
feat: between rule for numeric types #174
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
feat: between rule for numeric types #174
Conversation
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.
Couple small changes to tidy up.
array_push($rules, 'unique:' . $context . ',' . $column->name()); | ||
} | ||
|
||
if (Str::contains($column->dataType(), 'decimal')) { |
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.
These could all be refactored to in_array
as the dataType
will always been one of those.
@jasonmccreary I've already removed the default values, but in order to use What do you want me to do? |
@Pr3d4dor, maybe I've forgotten now, but I thought the root dataType was always Either way, it seems to me you only need to know if the data type contains any of the numeric types and specifies a value. If so, then add the My goal is always to write as little code as possible. Not one liners necessarily. But simple, readable code. Give it one more review to see if you see anything. Then I will merge it. |
@jasonmccreary Ok, I'll take a look and update the pull request if necessary. |
DECIMAL, FLOAT and DOUBLE aren't the same thing: Laravel Code:
|
Ok. What's your point? |
@jasonmccreary Just to verify if |
No worries. I'll finish this up. It'll be faster for me to just make the changes. On a side note, I've noticed your last few PRs have a bunch of "merge master" commits. You can avoid this and have a cleaner PR by first pulling in the latest changes from Blueprint into your local |
Closes #24