title: Keying an eager-loaded relationship
body: <p>I have a Business model and an Hour model. The Business model overrides the <code>protected $with</code> method to eager load it's <code>hours() hasMany</code> relationship.</p>
  
  <p>When I <code>::first()</code> a given business I receive something like this:</p>
  
  <pre><code>App\Business {#770
   id: 5,
   user_id: 5,
   name: "Wehner-Hudson",
   slug: "wehner-hudson",
   lat: "55.33593500",
   lng: "112.34818600",
   created_at: "2018-01-04 13:00:48",
   updated_at: "2018-01-04 13:00:48",
   hours: Illuminate\Database\Eloquent\Collection {#753
     all: [
       App\Hour {#802
         id: 13,
         business_id: 5,
         weekday_id: 3,
         open: 1,
         split_shift: 1,
       },
       App\Hour {#803
         id: 14,
         business_id: 5,
         weekday_id: 5,
         open: 0,
         split_shift: 1,
       },
       App\Hour {#804
         id: 15,
         business_id: 5,
         weekday_id: 2,
         open: 1,
         split_shift: 0,
       },
     ],
   },
  },
  ],
  }
  </code></pre>
  
  <p>I would like to key the <code>hours: Illuminate\Database\Eloquent\Collection {#753</code> by <code>weekday_id</code> to facilitate processing on the client side. Something like this:</p>
  
  <pre><code>Illuminate\Database\Eloquent\Collection {#763
  all: [
  1 =&gt; App\Hour {#796
   id: 1,
   business_id: 1,
   weekday_id: 1,
   open: 1,
   split_shift: 1,
  },
  5 =&gt; App\Hour {#767
   id: 2,
   business_id: 1,
   weekday_id: 5,
   open: 0,
   split_shift: 0,
  },
  2 =&gt; App\Hour {#765
   id: 3,
   business_id: 1,
   weekday_id: 2,
   open: 1,
   split_shift: 1,
  },
  ],
  }
  </code></pre>
  
  <p>I tried to use keyBy on the relationship in the Business model:</p>
  
  <pre><code>public function hours()
  {
     return $this-&gt;hasMany(Hour::class)-&gt;keyBy('weekday_id'); 
  } 
  </code></pre>
  
  <p>But it is not working, as I believe that at that point the returned object is a builder, not a collection.</p>