Answer the question
In order to leave comments, you need to log in
How to make model feedback on itself in Eloquent Laravel?
You need to implement category exclusion. That is, to one category, others are indicated that are considered mutually exclusive.
In the Category model, I made a link
Category {
public function excludes()
{
return $this->belongsToMany(Category::class, 'excludes_cetegories', 'category_id', 'exclude_id');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question