title: Laravel order by a nested eager load relationship
body: <p>Firstly, I tried looking at <a href="https://stackoverflow.com/questions/30232831/laravel-eager-loading-sort-by-relationship">this</a>, but I couldn't get the solution to work, as it had pivot tables involved, which mine does not. My brain couldn't abstract the solution from that solution.</p>
  
  <p>I have this query:</p>
  
  <pre><code>$orderLines = PurchasingOrderLine::where('season_id', '=', $seasonRecID)
          -&gt;with('factory')
          -&gt;with('purchasingFactoryDates.milestone')
          -&gt;with('divergedColors.purchasingColorDates.milestone')
          -&gt;get();
  </code></pre>
  
  <p>So it's quite a big relationship.</p>
  
  <p>I want to sort the <code>purchasingFactoryDates</code> by their <code>milestone</code>'s "number" attribute.</p>
  
  <p>Here is a sample of the JSON response for this query (a sample)..</p>
  
  <pre><code>  {
      id: 1,
      season_id: 258,
      factory_id: 38,
      archived: 0,
      created_at: "2016-10-03 00:00:00",
      updated_at: "2016-10-04 00:00:00",
      factory: {
         ID: 38,
         name: "testfac",
         address: "testadrr",
         postCode: "",
         city: "Foo",
         countryID: 27,
         podID: 2,
         warehouse_id: 3,
         paymentTermID: 11,
         factoryCode: "Bazz",
         active: 1
      },
      purchasing_factory_dates: [
        {
          id: 1,
          purchasing_order_line_id: 1,
          milestone_id: 1,
          milestone_date: "1993-10-22 19:15:51",
          milestone_status_id: 2,
          created_at: "2016-10-04 07:38:30",
          updated_at: "2016-10-18 19:15:51",
          milestone: {
            id: 1,
            name: "test1",
            description: null,
            number: 1,
            created_at: "-0001-11-30 00:00:00",
            updated_at: "-0001-11-30 00:00:00"
          }
        },
      .........
  </code></pre>
  
  <p>Any ideas on how to do this? I don't want the entire relation to be sorted by the <code>Milestone.number</code>, only the <code>purchasingFactoryDates</code>.</p>