where('category_id', $record->id)->count();