Dzień Carbon 30 dni temu
Carbon::parse('2021-07-30')->subDays(30)->format('Y-m-d 00:00:00');
Shadow
Carbon::parse('2021-07-30')->subDays(30)->format('Y-m-d 00:00:00');
$users = Users::where('status_id', 'active')
->where( 'created_at', '>', Carbon::now()->subDays(30))
->get();
$dt =Carbon::now();
echo $dt->subDay(); // 2012-03-03 00:00:00
echo $dt->subDays(29);
$startdate->diffInDays($todate); //total days between two dates
$startdate->diffInMinutes($todate); //total number of minutes between two dates
$startdate->diffInMonths($todate); //total number of months difference