| @@ -389,9 +389,9 @@ | ||
| 389 | 389 | ->latest() |
| 390 | 390 | ->get(); |
| 391 | 391 | |
| 392 | 392 | $formattedCalendars = []; |
| 393 | - foreach ($calendars as $index => $calendar) { | |
| 393 | + foreach ($calendars as $calendar) { | |
| 394 | 394 | $slots = Arr::get($calendar, 'slots'); |
| 395 | 395 | if (!empty($slots)) { |
| 396 | 396 | $options = []; |
| 397 | 397 | foreach ($slots as $slot) { |
| @@ -400,9 +400,9 @@ | ||
| 400 | 400 | 'value' => Arr::get($slot, 'id') |
| 401 | 401 | ]; |
| 402 | 402 | } |
| 403 | 403 | if (!empty($options)) { |
| 404 | - $formattedCalendars[$index] = [ | |
| 404 | + $formattedCalendars[] = [ | |
| 405 | 405 | 'label' => Arr::get($calendar, 'title'), |
| 406 | 406 | 'options' => $options |
| 407 | 407 | ]; |
| 408 | 408 | } |
| @@ -438,9 +438,9 @@ | ||
| 438 | 438 | |
| 439 | 439 | $calendars = $calendarsQuery->latest()->get(); |
| 440 | 440 | |
| 441 | 441 | $formattedCalendars = []; |
| 442 | - foreach ($calendars as $index => $calendar) { | |
| 442 | + foreach ($calendars as $calendar) { | |
| 443 | 443 | $slots = Arr::get($calendar, 'slots'); |
| 444 | 444 | if (!empty($slots)) { |
| 445 | 445 | $options = []; |
| 446 | 446 | foreach ($slots as $slot) { |
| @@ -449,9 +449,9 @@ | ||
| 449 | 449 | 'title' => Arr::get($slot, 'title') |
| 450 | 450 | ]; |
| 451 | 451 | } |
| 452 | 452 | if (!empty($options)) { |
| 453 | - $formattedCalendars[$index] = [ | |
| 453 | + $formattedCalendars[] = [ | |
| 454 | 454 | 'id' => Arr::get($calendar, 'id'), |
| 455 | 455 | 'title' => Arr::get($calendar, 'title'), |
| 456 | 456 | 'options' => $options |
| 457 | 457 | ]; |