@if($widget->type == 'image_link')
@elseif($widget->type == 'video')
@elseif($widget->type == 'text')
{!! $widget->content !!}
@elseif($widget->type == 'calendar')
@php
$now = \Carbon\Carbon::now();
$currentMonth = $now->format('F Y');
$daysInMonth = $now->daysInMonth;
$firstDayOfWeek = $now->copy()->startOfMonth()->dayOfWeek; // 0 (Sun) - 6 (Sat)
$today = $now->day;
@endphp
{{ $currentMonth }}
| S |
M |
T |
W |
T |
F |
S |
@php $cellCount = 0; @endphp
@for($i = 0; $i < $firstDayOfWeek; $i++)
|
@php $cellCount++; @endphp
@endfor
@for($day = 1; $day <= $daysInMonth; $day++)
@if($cellCount % 7 == 0 && $cellCount != 0)
@endif
|
{{ $day }}
|
@php $cellCount++; @endphp
@endfor
@while($cellCount % 7 != 0)
|
@php $cellCount++; @endphp
@endwhile
@elseif($widget->type == 'link')
@endif