@extends('admin.layouts.app') @section('title', 'Blog Posts') @section('content')
@php $statusColors = ['published'=>'badge-green','draft'=>'badge-gray','scheduled'=>'badge-amber']; @endphp {{-- Tabs --}}
@foreach(['all'=>'All','published'=>'Published','draft'=>'Draft','scheduled'=>'Scheduled'] as $s=>$l) {{ $l }} {{ $counts[$s] }} @endforeach
@if(request()->anyFilled(['q','cat'])) Clear @endif
@forelse($posts as $post) @empty @endforelse
TitleCategoryStatusAuthorPublished
{{ $post->title }}
@if($post->excerpt)
{{ $post->excerpt }}
@endif
{{ $post->category?->name ?? '—' }} {{ ucfirst($post->status) }} {{ $post->author?->name ?? '—' }} {{ $post->published_at?->format('d M Y') ?? '—' }}
@csrf @method('DELETE')
@if($posts->hasPages())
{{ $posts->appends(request()->query())->links() }}
@endif
@endsection