Selam.
@php
$dates = [];
foreach ($myCaravans->availabilityCalendar as $record) {
$start_date = $record->start_date;
$end_date = $record->end_date;
$dates_range = [];
$date = new DateTime($start_date);
$end_date = new DateTime($end_date);
while ($date <= $end_date) {
$dates_range[] = $date->format('Y-m-d');
$date->modify('+1 day');
}
$dates = array_merge($dates, $dates_range);
}
@endphp
@push('js')
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script>
$( '.flatpickr' ).flatpickr({
dateFormat: "Y-m-d",
disable: {!! $dates !!},
mode: "multiple"
});
</script>
@endpush
Bu sorunu disable: {!! json_encode($dates) !!} yaparak çözdüm.