diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php index 567159c58f..0e5b6cb536 100644 --- a/app/Http/Controllers/Api/StatuslabelsController.php +++ b/app/Http/Controllers/Api/StatuslabelsController.php @@ -167,10 +167,7 @@ class StatuslabelsController extends Controller { $this->authorize('view', Statuslabel::class); - $statuslabels = Statuslabel::with('assets') - ->groupBy('id') - ->withCount('assets as assets_count') - ->get(); + $statuslabels = Statuslabel::withCount('assets')->get(); $labels=[]; $points=[];