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

How to get Laravel Application root path ?
How to check the Laravel version in your project
How to Use Query Scope in Laravel Eloquent
How to get full URL in Laravel