Fixed #9680: Use Eloquent’s withCount method to count Statuslabel assets

This commit is contained in:
Travis Miller 2021-06-09 11:52:04 -05:00
parent 6c1dd81e0a
commit 4f6b1bb12d

View file

@ -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=[];