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

[9.x] Add havingNull to query builder #37228

Merged
merged 1 commit into from
May 3, 2021
Merged

[9.x] Add havingNull to query builder #37228

merged 1 commit into from
May 3, 2021

Conversation

amir9480
Copy link
Contributor

@amir9480 amir9480 commented May 3, 2021

This PR adds havingNull and havingNotNull support to the query builder class.
The syntax is exactly like whereNull and whereNotNull.

Example code before this change:

User::select(...)
    ->join(...)
    ->groupBy(...)
    ->havingRaw('users.sample_column is null')
    ->get();

Same code after this change:

User::select(...)
    ->join(...)
    ->groupBy(...)
    ->havingNull('sample_column')
    ->get();

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.

2 participants