I am using Laravel 10.
This is crm_details table:
I need to count each status, that is Yes 3, No 3. Also I need to consider parent_token with the same value as a single row for that I have used the following query:
$salesCounts = DB::table('crm_details')
->select( DB::raw('count(crm_details.status) as count'),'crm_details.parent_token')
->groupBy('crm_details.status', 'crm_details.parent_token')
->get();
dd($salesCounts);
But I am getting all the data, what is wrong?
