title: How to access the nth object in a Laravel collection object?
body: <p>I have a laravel collection object.</p>
  
  <p>I want to use the nth model within it.</p>
  
  <p>How do I access it?</p>
  
  <p>Edit:</p>
  
  <p>I cannot find a suitable method in the <a href="http://laravel.com/docs/eloquent#collections">laravel documentation</a>. I could iterate the collection in a foreach loop and break when the nth item is found:</p>
  
  <pre><code>foreach($collection as $key =&gt; $object)
  {
      if($key == $nth) {break;}
  }
  // $object is now the nth one
  </code></pre>
  
  <p>But this seems messy.</p>
  
  <p>A cleaner way would be to perform the above loop once and create a simple array containing all the objects in the collection. But this seems like unnecessary duplication.</p>
  
  <p>In the <a href="http://laravel.com/api/class-Illuminate.Support.Collection.html#_fetch">laravel collection class documentation</a>, there is a fetch method but I think this fetches an object from the collection matching a primary key, rather than the nth one in the collection.</p>