title: Laravel: Convert Eloquent collection to Array without converting elements
body: <p>Is there a (simple) way to convert an Eloquent Collection to an actual array without converting the elements themselves?</p>
  
  <p>I get in trouble when I try to pass the collection into a php method like <code>array_rand($collection)</code>. This gives me the error: <code>array_rand() expects parameter 1 to be array, object given</code>.</p>
  
  <p>I worked around this by using <code>$collection-&gt;shuffle()-&gt;first();</code> which works fine and of course I could loop over the collection and push all in an array, but just out of curiosity I wonder if I'm overlooking something.</p>
  
  <p><strong>Update / Conclusion</strong></p>
  
  <p>There seems to be a difference between the <code>all</code> method on a <code>Illuminate\Support\Collection</code> and a <code>Illuminate\Database\Eloquent\Collection</code>.
  The all on an Eloquent Collection returns a Support Collection and the Support Collection returns an Array.</p>
  
  <p>So to get an Array of Eloquent models you need to use <code>SomeModel::all()-&gt;all();</code></p>