I'm working in laravel and I need to filter the users who orders with certain amount of money in orders 
so I used to filter the orders count

```
 User::where('type','client')
            ->has('orders', '>=', $min_orders)
            ->has('orders', '<=', $max_orders)
            ->withCount('orders')
        ->paginate(25)
        ;

```