title: Laravel Eloquent retrieve the first element and also keep the query result intact?
body: <p>Please have a look at the following code:</p>
  
  <pre><code>$msgs = Message::where(function($query) use ($start,$end){
  
      $query-&gt;whereBetween('created_at', array($start, $end));
  
  })-&gt;orderBy('created_at', 'DESC');
  
  $first = $msgs-&gt;first()-&gt;created_at;
  $ids = $msgs-&gt;lists('id');
  </code></pre>
  
  <p>What I'm trying to do is to get the latest date of the query result set and get all the ids from the result at the same time. But the code doesn't work because the $msgs was changed by the $msgs->first() function. I'm wondering if there is a way to let me get the first element of the query result without affecting the whole result set? Thanks</p>