title: laravel filter elequent data by where clause or reuse elequent data
body: <p>I want to reuse laravel elequent data. I don't know that question is meaning full. so I will explain using bellow coding.
  I want to get some data using bellow coding.</p>
  
  <pre><code>$pending = Case::where('user_id', $id)-&gt;where('status', 0)-&gt;paginate(20);
  $approved = Case::where('user_id', $id)-&gt;where('status', 1)-&gt;paginate(20);
  </code></pre>
  
  <p>but I think it is not a efficient way.
  so I use bellow codding instead above code.
  first time get parent data to variable.</p>
  
  <pre><code>$cases = Case::where('user_id', $id);
  </code></pre>
  
  <p>after I try to filter child data from above variable using where clause.</p>
  
  <pre><code>$pending = $cases-&gt;where('status', 0)-&gt;paginate(20);
  $approved = $cases-&gt;where('status', 1)-&gt;paginate(20); 
  </code></pre>
  
  <p>after executing $pending has right data. but $approved not as I wish.
  How can I do that. Thanks.</p>