{{-- checkbox --}} {{-- title (flex, takes remaining space) --}} {{-- slug --}} {{-- status --}} {{-- created at --}} {{-- actions --}} @php $currentSort = request()->query('sort', ''); $currentDir = request()->query('dir', ''); if (!in_array($currentDir, ['asc', 'desc'], true)) { $currentDir = ''; } $isEmpty = $data->isEmpty(); $sortIcon = function (string $col) use ($currentSort, $currentDir, $isEmpty) { if ($isEmpty) return ''; $active = $currentSort === $col; $upActive = $active && $currentDir === 'asc'; $downActive = $active && $currentDir === 'desc'; $upClass = $upActive ? 'text-white' : 'text-white/40'; $downClass = $downActive ? 'text-white' : 'text-white/40'; return sprintf( '', $upClass, $downClass ); }; @endphp {{-- Checkbox (select-all) --}} @if(!$isEmpty) @endif
{{ __('pages/admin/blog.table.title') }} {!! $sortIcon('title') !!}
{{ __('pages/admin/blog.table.short_description') }}
{{ __('pages/admin/blog.table.status') }}
{{ __('pages/admin/blog.table.created_at') }}
{{ __('pages/admin/blog.table.actions') }}
@foreach($data as $blog)
@if($blog->image_url) {{ $blog->title }} @else
@endif {{ Str::limit($blog->title, 80) }}
{{ Str::limit($blog->short_description, 100) }} @if(!($isArchivedPage ?? false)) {{-- Interactive status dropdown (active blogs page only) --}} @foreach($statuses as $status) @endforeach @else {{-- Read-only badge on archived page --}} {{ $blog->status_label }} @endif {{ $blog->created_at->format('M d, Y') }}
@if($isArchivedPage ?? false) {{-- Restore --}} @else {{-- View --}} {{-- Edit --}} {{-- Delete --}} @endif
@endforeach @if($data->isEmpty() && ($totalBlogs ?? 0) > 0)

{{ __('pages/admin/blog.no_data.title') }}

{{ __('pages/admin/blog.no_data.description') }}

{{ __('buttons.filter.clear') }}
@endif
{{ $data->links('components.ajax-pagination') }}