Is there a query, with PHP date or Carbon to get data created x minutes ago?
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.
Edit per answer: To return all data created between 3 minutes ago and now.
$three_minutes_ago = Carbon::now()->subMinutes(3)->toDateTimeString();
$foo = Foo::where('created_at', '<', $three_minutes_ago)->get(); // Is this correct?
$foo is always empty no matter data is in Foo. I've used tinker to create/save data,