I have this line of code that gets the results from the database:
'clanMembers' => User::find(Auth::user() -> clan_id) -> where('clan_id', '=', Auth::user() -> clan_id) -> orderBy('username') -> get()
He is currently ordering a username. I want to change this to order in the clan_rank field. This clan_rank field will contain only 3 different values. It:
1. Owner
2. Admin
3. Member
I want my results to be ordered from the Owners first, then the Administrator, then the members. How can I change my line of code to achieve these results?
source
share