@extends('layouts.app') @section('title', (is_ar()?$post->title_ar:$post->title_en).' — '.site_name()) @section('description', is_ar()?$post->excerpt_ar:$post->excerpt_en) @section('content')
{{ $post->published_at->format('Y-m-d') }} | {{ $post->category }} @if($post->author) | ✍️ {{ $post->author->name }} @endif | 👁️ {{ $post->views }}

{{ is_ar()?$post->title_ar:$post->title_en }}

@if($post->cover)
@endif
{!! is_ar()?$post->content_ar:$post->content_en !!}
@if($post->tags)
@foreach(explode(',',$post->tags) as $tag) #{{ trim($tag) }} @endforeach
@endif {{-- Related Posts --}} @if($related->count() > 0)

{{ t('مقالات ذات صلة','Related Posts') }}

@foreach($related as $r) @if($r->cover)@endif
{{ is_ar()?$r->title_ar:$r->title_en }}
{{ $r->published_at->format('Y-m-d') }}
@endforeach
@endif {{-- Comments Section --}} @php $commentsEnabled = setting('comments_enabled','1') === '1'; try { $commentsTableExists = \Illuminate\Support\Facades\Schema::hasTable('ms_comments'); } catch(\Exception $e) { $commentsTableExists = false; } @endphp @if($commentsEnabled && $commentsTableExists)

💬 {{ t('التعليقات','Comments') }} @php $approvedCount = $post->comments()->where('status','approved')->count(); @endphp @if($approvedCount > 0){{ $approvedCount }}@endif

{{-- Existing Comments --}} @php $comments = $post->comments()->where('status','approved')->latest('created_at')->get(); @endphp @forelse($comments as $comment)
{{ mb_strtoupper(mb_substr($comment->name,0,1,'UTF-8')) }}
{{ $comment->name }}
{{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}

{{ $comment->content }}

@empty

{{ t('لا يوجد تعليقات بعد — كن أول من يعلق!','No comments yet — be the first to comment!') }}

@endforelse {{-- Comment Form --}} @if(session('success'))
✅ {{ session('success') }}
@endif @if($errors->has('captcha_answer'))
❌ {{ $errors->first('captcha_answer') }}
@endif

✏️ {{ t('أضف تعليقاً','Add a Comment') }}

@csrf
{{ t('لن يُنشر','Will not be published') }}
{{-- Math Captcha --}} @php $n1 = rand(1,9); $n2 = rand(1,9); session(['captcha_result' => $n1 + $n2]); @endphp
@if(setting('comments_auto','0') === '0') ⏳ {{ t('سيظهر بعد المراجعة','Will appear after review') }} @endif
@endif
← {{ t('رجوع للمدونة','Back to Blog') }}
@endsection