In Laravel 4/5 how can order a table results based in a field that are connected to this table by a relationship?
My case:
I have the users
that only store the e-mail
and password
fields. But I have an another table called details
that store the name
, birthday
, etc...
How can I get the users
table results ordering by the details.name
?
P.S.: Since users is a central table that have many others relations and have many items, I can't just make a inverse search like Details::...