Skip to content

Commit

Permalink
Improved filtered users rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai George authored and Mihai George committed Jun 17, 2017
1 parent f4d54db commit 0222e77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php-laravel/app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function users()
$data = User::whereHas('countries', function($query) {
$query->where('name', 'France');
})
->with('countries')
->has('countries', '>=', 5)
->withCount('countries')
->get();

return response()->json(['data' => $data]);
Expand Down

0 comments on commit 0222e77

Please sign in to comment.