title: Laravel - Sorted collection output is not an array
body: <p>I'm trying to sort a collection by the column <code>name</code>. I am logging the ajax result and when I sort by <code>name</code> I get:</p>
  
  <p><code>Object: {0: Object, 1: Object, ...}</code></p>
  
  <p>But when I sort by the other field (<code>locationId</code>) I get:</p>
  
  <p><code>[Object, Object, ...]</code></p>
  
  <p>Any idea what I'm doing wrong? I need the result in an array like when I sort by <code>locationId</code>.</p>
  
  <pre><code>public function getLocations()
  {
      return \Location::all(['locationId', 'name'])-&gt;sortBy('name');
  }
  </code></pre>