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

Eloquent method whereHas works regardless of method with #19392

Closed
projct1 opened this issue May 29, 2017 · 1 comment
Closed

Eloquent method whereHas works regardless of method with #19392

projct1 opened this issue May 29, 2017 · 1 comment

Comments

@projct1
Copy link

projct1 commented May 29, 2017

  • Laravel Version: 5.4.23

Description:

User::whereHas('posts', function ($builder) {
    $builder->where('title', 'Foo');
})->with('posts')->get();

Now all users have all post (constraint are not apply to with method).

If this not bug, can we add new method whereHasAndWith? Discussion about this: laravel/ideas#606

@themsaid
Copy link
Member

Yeah it's not a bug, feel free to open a PR or keep the issue opened on internals for discussion.

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

No branches or pull requests

2 participants