title: Laravel 5.2 Eloquent Use of Select in Eagerly Loaded Query
body: <p>I can get this to work using a select:</p>
  
  <pre><code>User::whereNotIn('id', $ids)
      -&gt;select(['id', 'email'])
      -&gt;with('profile')
      -&gt;get();
  </code></pre>
  
  <p>I'd like to only retrieve a couple keys in a user profile that is eagerly loaded.  I'd like to do something like this:</p>
  
  <pre><code>User::whereNotIn('id', $ids)
      -&gt;select(['id', 'email'])
      -&gt;with(['profile', function ($query) {
          $query-&gt;select(['id', 'user_id', 'first_name', 'last_name']);
      }])-&gt;get();
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>User::whereNotIn('id', $ids)
      -&gt;select(['id', 'email'])
      -&gt;with(['profile', function ($query) {
          $query-&gt;addSelect(['id', 'user_id', 'first_name', 'last_name']);
      }])-&gt;get();
  </code></pre>
  
  <p>But this doesn't seem to work, and I get this error:</p>
  
  <pre><code>ErrorException in Builder.php line 1034:
  explode() expects parameter 2 to be string, object given
  </code></pre>
  
  <p>Thrown in /Illuminate/Database/Eloquent/Builder.php:</p>
  
  <pre><code>/**
   * Parse the nested relationships in a relation.
   *
   * @param  string  $name
   * @param  array   $results
   * @return array
   */
  protected function parseNestedWith($name, $results)
  {
      $progress = [];
  
      // If the relation has already been set on the result array, we will not set it
      // again, since that would override any constraints that were already placed
      // on the relationships. We will only set the ones that are not specified.
      foreach (explode('.', $name) as $segment) { // &lt;--- line 1034
          $progress[] = $segment;
  
          if (! isset($results[$last = implode('.', $progress)])) {
              $results[$last] = function () {
                  //
              };
          }
      }
  
      return $results;
  }
  </code></pre>
  
  <p>Is there a way to accomplish this?</p>