Merge pull request #9681 from tulsaschoolsdata/9680-fix-statuslabels-asset-count

Fixed #9680: Use Eloquent’s `withCount` method to count Statuslabel assets
This commit is contained in:
snipe 2021-06-23 14:34:34 -07:00 committed by GitHub
commit c801305c9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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