public function scopeHasCategories($query, $taxonomy_ids)
    {
        return $query->whereHas('taxed', function($q) use($taxonomy_ids) {
            $q->whereIn('taxonomy_id', $taxonomy_ids);
        });
    }