TaxClass::list()]; } protected function query() { return TaxClass::select('id') ->when(request()->has('tax_class'), function (Builder $query) { $query->where('id', request('tax_class')); }) ->withCount('products') ->orderByDesc('products_count'); } }