Answer the question
In order to leave comments, you need to log in
How to make a selection of data with conditions in a related table "Many to many"?
Perhaps somehow I did not write the title correctly, but I will try to describe in more detail.
An example is a model where supplier data is stored (Model1). The second model stores a set of all properties (Model2). There is a many-to-many relationship (with the conventional name Relation1).
The question is how, when selecting Model1, to make what would be the condition in the many-to-many relationship?
// Как мне при работе с Eloquent запросом указать условие для выборки для связи в Relation1.
// Т.е. как мне выбрать поставщика с у которого есть определенное свойство?
$result = Model1:with('Relation1')->get();
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