I want to count the number of employees that have published their goals and groupby employee_id where is_published is 1.
$testing = Goal::where('is_published', 1)->where('company_id', $userCompany)->groupBy('employee_id')->count();
From the table I have four (4) rows but the same employee_id, I expected to get 1 but I am getting 4?
dd($testing) gives me 4
How do I achieve this?