Skip to content
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

Added two methods incrementEach and decrementEach #2550

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from

Conversation

SmallRuralDog
Copy link

add incrementEach
add decrementEach

add incrementEach
add decrementEach
@GromNaN
Copy link
Member

GromNaN commented Aug 25, 2023

Hello, thanks for the suggestion. For reference, this methods were added by laravel/framework#45577.

Would you like to rebase the PR, add tests in QueryBuilderTest and update the changelog?

$this->where(function ($query) use ($column) {
$query->where($column, 'exists', false);

$query->orWhereNotNull($column);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With cumulative conditions on all fields, no field will be incremented if at least 1 of the fields is null.

We'd be wise not to set any conditions at all and let the server return an error.

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comment by @GromNaN and add tests for the new functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants