@MichalOravec great article, but I have another question since my relationship itself is more complex than the ones in the article. I used this library to make the relationship https://github.com/topclaudy/compoships
public function salePointRoute()
{
return $this->belongsTo(SalePointRoute::class, ['route_id', 'sale_point_id'], ['route_id', 'sale_point_id']);
}
In this case would I do two join statements one with route_id and the other with sale_point_id?
@MichalOravec last question, this is my query, now it's ordered correctly but I have a lot of duplicates (3 vs 9), I know that can be fixed with a ->get()->unique() after but I wanted to understand why that is happening.