title: Laravel replicate() function is not working for model collection
body: <p>i have facing a problem at laravel.</p>
  
  <p><strong>I want to replicate/clone of collection after apply filter the collection.</strong></p>
  
  <h2>code is below:</h2>
  
  <pre><code>/* Scope function */         
      $plansFilterIndexes=Plans::PlansFilterFields();
       $planFilters=Plans::FilterFieldsSerial($query);
       /* Create Plans collection */
  
       $PlansAll=Plans::all();
  
      /* Plans Filter by url 
       * here checking $planFilter  indexes IS AVALIABLE AT 
       *  DEFINED  INDEX $plansFilterIndexes
       */
      $query = null;
          foreach($planFilters as $eachIndexKey =&gt; $eachIndexValue):
          echo $eachIndexKey.'------'.$eachIndexValue.'&lt;br/&gt;';
          if(array_search($eachIndexKey, $plansFilterIndexes) != false):
  
              $PlansAll = $PlansAll-&gt;where($eachIndexKey, $eachIndexValue);
          endif;
      endforeach;
      //dd($PlansAll);
      /* Clone collection into new once for copy */
  
      $PlansAllClone =$PlansAll-&gt;replicate();
      dd($PlansAllClone);
  </code></pre>
  
  <p>Try with <a href="https://stackoverflow.com/questions/23895126/clone-an-eloquent-object-including-all-relationships">Clone an Eloquent object including all relationships?</a>  solution  but did not get result</p>
  
  <p><strong>Show error:</strong> <code>Method replicate does not exist.</code></p>
  
  <p>It not working.</p>
  
  <p><strong>Question:</strong></p>
  
  <p><em>Why $PlansAllClone =$PlansAll->replicate(); is failed to give result.
  and if it not possiable ,show i will achieve it.</em></p>