I am using Query Builder and here is my code in Laravel5
$users = DB::table('brand_customers')
->select('brand_id')
->where('mobile', $mobile)
->take(15)
->get();
I am limiting to 15 records but I am also looking for total count. Currently, I am getting count using this.
$users->count();
I tried the above code but no luck. How can I get both the data and count with the same query. Thanks.