title: Laravel - select rows from previous week on monday
body: <p>I have a table <strong>mdl_forum_posts</strong> with a field <strong>created</strong> that's a <em>BIGINT</em> (database is not mine, so don't blame for the type of field). An example of value is <em>1504170577</em>. The value is saved as a timestamp. </p>
  
  <p>There will run a cron every Monday (first day of the week) that needs to select all the rows created in the previous week (created value in week before).</p>
  
  <p>I'm trying to do this:</p>
  
  <pre><code>$currentDate = \Carbon\Carbon::now();
  $agoDate = $currentDate-&gt;subDays($currentDate-&gt;dayOfWeek)-&gt;subWeek();
  
  $postsNL = DB::table('mdl_forum_posts')-&gt;whereBetween('created', array($agoDate,$currentDate))-&gt;get();
  </code></pre>
  
  <p>But this isn't returning any rows (and it should!).</p>