@extends('admin.layouts.home') @section('title', __('Manage Posts')) @section('content')

{{ __('Manage Posts') }}

{{ __('Posts List') }}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@forelse($posts as $post) @empty @endforelse
{{ __('ID') }} {{ __('Post Type') }} {{ __('Text Preview') }} {{ __('User') }} {{ __('Created') }} {{ __('Actions') }}
{{ $post->id }} {{ ucfirst(str_replace('_', ' ', $post->post_type ?? 'post')) }} @if($post->post_text) {{ Str::limit(strip_tags($post->post_text), 20) }} @else {{ __('No text') }} @endif @if($post->user) {{ $post->user->name ?? $post->user->username ?? 'Unknown' }} @else {{ __('Unknown') }} @endif {{ $post->created_at->format('M d, Y H:i') }}
@csrf @method('DELETE')
{{ __('No posts found') }}
{{ $posts->links('pagination::bootstrap-5') }}
@endsection