I have a query which joins one table with another one in a one to one relation. How can I sort the result by a column in the joining relation
$relation = ModelObject::where('status', '=', 1)
->with('related_table')
->get()
I need to sort this with a column(Eg: name) of related_table
. How to do this in eloquent.