Level 4
if( Carbon::now()->subDay(5) <= $date)
{
//do your thing
}
or
if( $date->addDay(5) >= Carbon::now() )
{
//do your thing
}
Read more here http://carbon.nesbot.com/docs/#api-addsub
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to know if a user was registered in the last 5 days.
But the only thing is a string date. like that
$date = "2015-08-03 11:52:52";
How do I check that with Carbon or simple PHP
Please or to participate in this conversation.