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

[5.2] Accept != and <> as operators while value is null #13370

Merged
merged 1 commit into from
Apr 29, 2016
Merged

[5.2] Accept != and <> as operators while value is null #13370

merged 1 commit into from
Apr 29, 2016

Conversation

themsaid
Copy link
Member

As noted here #13314

Currently:

->where('done_at','=',null); // converted to whereNull
->where('done_at', '!=', null) // throws exception

This PR accepts != and <> as operators when the value given to where() is null, allowing the conversion of where with these operators to have the same effect as whereNotNull.

@srmklive
Copy link
Contributor

srmklive commented Apr 29, 2016

@themsaid There are already whereNull & whereNotNull functions available in query builder, then why is there a reason for changes for the where function to encompass the behavior of whereNull?

@themsaid
Copy link
Member Author

@srmklive where() accepts null as a value already, this PR just adds support for the != and <> operators.

@srmklive
Copy link
Contributor

@themsaid I am currently using both the != && <> operator in the where function in one of my apps. Haven't encountered any error you mentioned yet.

@themsaid
Copy link
Member Author

@srmklive if the value given is null, using these operators will throw an exception.

@taylorotwell taylorotwell merged commit ebcaba3 into laravel:5.2 Apr 29, 2016
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.

4 participants