@extends('layouts.app') @section('title', __('Blog Posts - Admin')) @section('content')
{{-- Page header --}}

{{ __('Blog Posts') }}

{{ __('Manage all blog posts, drafts and published articles.') }}

{{ __('New Post') }}
{{-- Alerts --}} @if(session('success')) @endif @if(session('status')) @endif @if(session('error')) @endif {{-- Statistics --}} @include('admin.blog.posts.partials.stats', [ 'stats' => $stats, ]) {{-- Filters --}}
{{-- Search --}}
{{-- Category --}}
{{-- Language --}}
{{-- Status --}}
{{-- Image filter --}}
{{-- Per page --}}
{{-- Preserve sorting --}}
{{ __('Reset') }}
{{ number_format($posts->total()) }} {{ trans_choice('post found|posts found', $posts->total()) }} @if($posts->total() > 0) ({{ $posts->firstItem() }}–{{ $posts->lastItem() }}) @endif
{{-- Bulk actions --}} @if($posts->isNotEmpty()) @endif {{-- Posts table --}}
@forelse($posts as $post) @php $postTitle = $post->title ?: __('Untitled'); $imageUrl = null; if (filled($post->image_small)) { $imageUrl = $post->storage === 'public' ? asset('storage/' . ltrim($post->image_small, '/')) : asset(ltrim($post->image_small, '/')); } @endphp {{-- Correct route-generated actions --}} @empty @endforelse
{{ __('ID') }} {{ __('Post') }} {{ __('Category') }} {{ __('Author') }} {{ __('Status') }} {{ __('Comments') }} {{ __('Date') }} {{ __('Actions') }}
#{{ $post->id }}
@if($imageUrl) {{ $postTitle }} @else
@endif
{{ \Illuminate\Support\Str::limit( $post->slug, 45 ) }}
{{ $post->category?->name ?: __('Uncategorized') }}
{{ $post->author?->username ?: __('Unknown') }}
@if(filled($post->author?->email))
{{ $post->author->email }}
@endif
@if($post->created_at) {{ __('Published') }} @else {{ __('Draft') }} @endif {{ number_format( (int) ($post->comments_count ?? 0) ) }}
@if($post->created_at)
{{ $post->created_at->format('M d, Y') }}
{{ $post->created_at->diffForHumans() }}
@else
{{ __('N/A') }}
{{ __('Not published') }}
@endif
{{-- View --}} {{ __('View') }} {{-- Edit --}} {{ __('Edit') }} {{-- Publish/unpublish --}}
@csrf @method('PATCH')
{{-- Duplicate --}}
@csrf
{{-- Delete --}}
@csrf @method('DELETE')
{{ __('No blog posts found') }}

{{ __('Try adjusting your search or filter criteria.') }}

{{ __('Create First Post') }}
{{-- Pagination --}} @if($posts->hasPages()) @endif
{{-- Bulk-action modal --}} @endsection @push('styles') @endpush @push('scripts') @endpush