{{-- filepath: resources/views/content_management/partials/events_table.blade.php --}}
{{-- Notification area for user feedback. References the parent component's variables. --}}
@php // Get the current sort column and direction from the request $sortColumn = request('sort', 'id'); $sortDirection = request('direction', 'asc'); // Helper function to generate a new sort URL $sortUrl = function ($column) use ($sortColumn, $sortDirection) { $newDirection = $sortDirection === 'asc' && $sortColumn === $column ? 'desc' : 'asc'; return request()->fullUrlWithQuery(['sort' => $column, 'direction' => $newDirection]); }; @endphp @forelse ($events as $event) @empty @endforelse
ID {{-- Show the directional icon if this is the sorted column, otherwise show a neutral icon. --}} @if ($sortColumn === 'id') @else @endif Title @if ($sortColumn === 'title') @else @endif Description @if ($sortColumn === 'desc') @else @endif Image Date @if ($sortColumn === 'date') @else @endif Active @if ($sortColumn === 'active') @else @endif Actions
{{ $event->id }} {{ $event->title }} {{ Str::limit($event->desc, 70) }} @if ($event->image) Event Image @else No Image @endif {{ $event->date->format('d/m/Y') }}
No events found.
{{ $events->links() }}