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
[Request] Making eloquent has() accept conditions #1166
Comments
👍 I'm currently using belongsToMany relation to attach tags to specific project. $keywords = ['laravel', 'php', 'developer'];
$projects = $category->projects()->has(array('tags' => function($query) use ($keywords) {
$query->whereIn('name', $keywords);
})); |
Or maybe allow this to be set when defining a eager load constraint: $projects = $category->projects()->with(array('tags' => function($query) use ($keywords) {
$query->whereIn('name', $keywords);
$query->has('>=', 1);
})); |
Closing for #1166. |
Is this going to be added to 4.0.x? |
Any news on when this will be added into a 4.0.* release? It was closed 11 days ago and 4.0.6 was released 7 days ago, so I guess it was missed? |
Guys, please add this.. really need it |
$users = User::has(array('posts' => function($query)
{
$query->where('created_at', '>', '2012-04-05');
}))->get();
This would make the has() function so more powerful:-)
The text was updated successfully, but these errors were encountered: