How do I get distinct values from the table along with the count of how many rows there are containing that value in laravel
- Yogesh Kumar
- 02-May-2022
- 0
Try This
Model::query()->groupBy('country_name')->select('counrty_name',DB::raw('COUNT(1)'))->get()
218 0
7
* Be the first to Make Comment