i have a requirement where it requires multiple where conditions in single query and i want to pass each condition to each variable to display the stats.
i have a table like below,
nominations table
id, user_id, status, file_name
now i want to get accepted, pending, rejected nominations. in single query so i tried query like below,
$nominations = Nomination::where('submited',1);
$approvedNominations = $nominations->where('status', 'Approved')->count();
$pendingNominations = $nominations->where('status', 'Pending')->count();
$rejectedNominations = $nominations->where('status', 'Rejected')->count();
but above code not showing proper count instead it s showing previous variable count in next variable.
please help me with this