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

[6.x] Query Builder whereIn shortcut #31369

Closed
wants to merge 4 commits into from
Closed

[6.x] Query Builder whereIn shortcut #31369

wants to merge 4 commits into from

Conversation

ddzobov
Copy link
Contributor

@ddzobov ddzobov commented Feb 5, 2020

Query Builder whereIn shortcut

Before:

$builder->select('*')->from('users')->where('foo', '<', 1)->whereIn('bar', [2, 3]);

$builder->select('*')->from('users')->where('foo', '=', 1)->whereIn('bar', [2, 3]);

After:

$builder->select('*')->from('users')->where([
    ['foo', '<', 1],
    ['bar', [2, 3]]
]);

$builder->select('*')->from('users')->where([
    'foo' => 1,
    'bar' => [2, 3]
]);

@decadence
Copy link
Contributor

Was already proposed and declined unfortunately 😔

@ddzobov
Copy link
Contributor Author

ddzobov commented Feb 6, 2020

Was already proposed and declined unfortunately 😔

can you attach your PR here?

@decadence
Copy link
Contributor

decadence commented Feb 6, 2020

That was not my PR but here it is: #19126
And discussion about this feature: laravel/ideas#572

@taylorotwell
Copy link
Member

Just use the whereIn method. This method is already large 😄

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.

3 participants