@php $items = \App\Models\Backend\ContentCalendar::with(['translations' => function($q) use ($lang) { $q->where('calendar_translation_language', $lang); }])->where('calendar_status', 'ACTIVE')->orderBy('calendar_date_start')->get(); $categories = \App\Models\Backend\Ref::where('cat', 'CALENDAR_CATEGORY')->pluck('descr', 'code'); $types = \App\Models\Backend\Ref::where('cat', 'CALENDAR_TYPE')->pluck('descr', 'code'); @endphp @if($items->count())
Kalendar

Kalendar Aktiviti

Senarai aktiviti, mesyuarat dan program yang akan datang.

@foreach($items as $item) @php $t = $item->translations->first(); @endphp
{{ date('d', strtotime($item->calendar_date_start)) }} {{ date('M', strtotime($item->calendar_date_start)) }}
@if($t)

{{ $t->calendar_translation_title }}

@endif
{{ $categories[$item->calendar_category] ?? $item->calendar_category }} {{ $types[$item->calendar_type] ?? $item->calendar_type }}
@if($t && $t->calendar_translation_location) {{ $t->calendar_translation_location }}@endif @if($t && $t->calendar_translation_content)

{{ Str::limit($t->calendar_translation_content, 120) }}

@endif
@if($item->calendar_time_start){{ substr($item->calendar_time_start, 0, 5) }}@endif @if($item->calendar_time_end)-{{ substr($item->calendar_time_end, 0, 5) }}@endif
@endforeach
@else

Tiada Aktiviti

Tiada aktiviti berjadual buat masa ini.

Kembali
@endif