title: Get data created x minutes ago in Laravel
body: <p>Is there a query, with PHP date or Carbon to get data created x minutes ago?</p>
  
  <p>In my example, I need all data created 3 minutes ago. If the time is 10:00 and data was created, then at when query is made 10:03, I should get all data created at 10:00. If query made 10:04, no data show be returned.</p>
  
  <blockquote>
    <p>Edit per answer: To return all data created between 3 minutes ago and now.</p>
  </blockquote>
  
  <pre><code>use App/Foo
  use Carbon\Carbon;
  
  [...]
  
  $three_minutes_ago = Carbon::now()-&gt;subMinutes(3)-&gt;toDateTimeString();
  $foo = Foo::where('created_at', '&lt;', $three_minutes_ago)-&gt;get(); // Is this correct?
  </code></pre>
  
  <p><code>$foo</code> is always empty no matter data is in <code>Foo</code>. I've used <code>tinker</code> to create/save data,</p>