Моя таблица предложений имеет следующий метод
/**
* Get the region for this offer.
*/
public function region()
{
return $this->belongsTo('App\Models\Region');
}
/**
* Get the categories for this offer.
*/
public function categories()
{
return $this->belongsToMany('App\Models\OfferCategory');
}
Моя категория предложений имеет следующий код
/**
* Get the parentCategory.
*/
public function parentCategory()
{
return $this->belongsTo('App\Models\OfferCategory');
}
/**
* Get the offers for this category.
*/
public function offers()
{
return $this->belongsToMany('App\Models\Offer');
}
Как получить записи для предложений с идентификатором категории и региона?