title: Laravel 5.4: select the records that's within 2 days only
body: <p>I am need to pull all the records that's within 2 days only for example
  today is 24/7 so I need all the records in 23/7 and 22/7</p>
  
  <p>I try this</p>
  
  <pre><code>-&gt;whereRaw('DATE(created_at) = DATE_SUB(CURDATE(), INTERVAL 2 DAY)')
  </code></pre>
  
  <p>but not working it gets the records from two days ago
  also try this </p>
  
  <pre><code>-&gt;whereDate( 'created_at', '&gt;', Carbon::now()-&gt;subDays( 2 ) )
  </code></pre>
  
  <p>but it includes the records from today also which I don't want.</p>
  
  <p>How should I do this using <code>carbon</code> or <code>DATE</code></p>