i have a project where i can access to company name like this:
$user->atc_results->first()->atc_company->name;
i'm tryng to order my results orderBy company_name but it doesn't work.
public function atc_results()
{
return $this->hasMany('Modules\Atc\Entities\AtcResult')->with("atc_company")->orderBy("atc_company.name","asc");
}
can you help me ?