title: Laravel Order by in one to many relation with second table column
body: <p>Hi i have tables with one to many relation</p>
  
  <p><strong>sectors</strong></p>
  
  <pre><code>id
  name
  position
  </code></pre>
  
  <p><strong>seat_plans</strong></p>
  
  <pre><code>id
  name
  sector_id
  </code></pre>
  
  <p>I just want to select all seat plans order by sectors.position. I tried</p>
  
  <pre><code> $seat_plans = SeatPlan::with(['sector' =&gt; function($q){
                                          $q-&gt;orderBy('position');
                                          }
                                      ])-&gt;get();
  </code></pre>
  
  <p>but it is not working. when i check The SQL it is generating query like </p>
  
  <pre><code>select * from seat_plans
  </code></pre>
  
  <p>can anybody please tell me how to do this?</p>