Laravel sort Relationship
问题 How can I sort my result with related tables? I have this tables: Clients and Managers (users table) Client.php <?php class Client extends Eloquent { protected $table = 'clients'; public function Manager(){ return $this->belongsTo('User','manager','id'); } public function Transaction(){ return $this->hasMany('ClientTransaction','client','id'); } } Users.php (default Laravel's model) My question is how can I query table clients to be sorted by Manager's name. Here is my code so far: public