If a category can have active and inactive items, filtering only on the active being true will not be enough in the case where a category has items of both. Consider changing the condition to ->where('active', '!=', false). This will exclude any inactive items.
Couple of additional points...
public function newEloquentBuilder($query): CategoryCollection
{
return new CategoryCollection($query);
}
...putting this on your Category model will cast any queries on Category to the collection you're manually instantiating here.
If you cast your active to a bool also, you can explicitly pass true/false to the where function. Probably can do it regardless as boolean would be cast to a numerical equivalent anyway