Laravel Carbon get all dates between date range

$period = CarbonPeriod::create('2022-01-14', '2022-01-20');

// Iterate over the period
foreach ($period as $date) {
    echo $date->format('Y-m-d');
}

// Convert the period to an array of dates
$dates = $period->toArray();

Related Post

Maksud

Maksud

I am a thinker, not a talker.