how to find two date under how many mondays find in laravel corban

Solutions on MaxInterview for how to find two date under how many mondays find in laravel corban by the best coders in the world

showing results for - "how to find two date under how many mondays find in laravel corban"
Luis
24 Oct 2016
1// its wrong methods 
2$dateDay = \Carbon\Carbon::now();//use your date to get month and year
3$now = Carbon::now(); // current date
4$end = Carbon::parse("2020-11-22"); //insert date
5$length = $end->diffInDays($now); //total days
6$resultDays = array('Monday' => 0,'Tuesday' => 0,'Wednesday' => 0,'Thursday' => 0,'Friday' => 0,'Saturday' => 0,'Sunday' => 0);
7// dd($end);
8foreach($days as $key => $value)
9{
10  dd($value);
11
12}
13while($now <= $end)
14{
15  if($now->englishDayOfWeek == "Friday")
16  {
17    dd("dsfs");
18  }
19
20}
21$year = $dateDay->year;
22$month = $dateDay->month;
23$days = $dateDay->daysInMonth;
24$mondays=[];
25foreach (range(1, $days) as $day) {
26  $date = \Carbon\Carbon::createFromDate($year, $month, $day);
27  if ($date->isMonday()===true) {
28    $mondays[]=($date->day);
29  }
30
31}
32dd($mondays);
33//@sujay