$dateDay = \Carbon\Carbon::now();
$now = Carbon::now();
$end = Carbon::parse("2020-11-22");
$length = $end->diffInDays($now);
$resultDays = array('Monday' => 0,'Tuesday' => 0,'Wednesday' => 0,'Thursday' => 0,'Friday' => 0,'Saturday' => 0,'Sunday' => 0);
foreach($days as $key => $value)
{
dd($value);
}
while($now <= $end)
{
if($now->englishDayOfWeek == "Friday")
{
dd("dsfs");
}
}
$year = $dateDay->year;
$month = $dateDay->month;
$days = $dateDay->daysInMonth;
$mondays=[];
foreach (range(1, $days) as $day) {
$date = \Carbon\Carbon::createFromDate($year, $month, $day);
if ($date->isMonday()===true) {
$mondays[]=($date->day);
}
}
dd($mondays);