Closed kushan2 closed 4 years ago
Perhaps sort companies by name, then iterate over the results, building a collection or array of users as you go using the inverse relationship users()
in the Company
model?
I have a situation in which I need to do this also. Has anyone found a resolution?
How do we sort record by Relationship for example I have,
In my model,
class UserProfile extends Moloquent { protected $collection = 'user_profiles';
}
I want to sort UserProfile by Company name. Is it possible?