use CarbonCarbonPeriod;

$period = CarbonPeriod::create('2021-06-14', '2021-06-20');

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

//result
2021-06-14
2021-06-15
2021-06-16
2021-06-17
2021-06-18
2021-06-19
2021-06-20

附:原生 PHP 获取两个日期之间的所有日期方法