@php $user = auth()->user(); if ($user->hasRole('super-admin')) $layout = 'layouts.superadmin'; elseif ($user->hasRole('advisor')) $layout = 'layouts.advisor'; elseif ($user->hasRole('moderator')) $layout = 'layouts.moderator'; else $layout = 'layouts.member'; $from = $from ?? request('from',''); $to = $to ?? request('to',''); $qText = $qText ?? request('q',''); $onlyPinned= $onlyPinned?? request('pinned','0'); $kpis = $kpis ?? [ 'total' => (int)($posts->total() ?? 0), 'pinned' => 0, 'with_media' => 0, 'comments' => 0, 'reactions' => 0, 'latest' => '', ]; @endphp @extends($layout) @section('title','منشوراتي') @section('content')
{{-- HERO --}}
منشوراتك فقط • ستايل سوشال

منشوراتي

هنا بتشوف منشوراتك مرتبة من الأحدث للأقدم + تفاعل/تعليقات بشكل مختصر.

ضمن الفلاتر
{{ number_format((int)($kpis['total'] ?? 0)) }}
{{-- KPIs --}}
@php $pill = fn($label,$val,$cls,$icon) => "
{$label}
{$val}
"; @endphp {!! $pill('المثبتة', (int)($kpis['pinned'] ?? 0), 'text-amber-200', 'fa-thumbtack') !!} {!! $pill('مع صور', (int)($kpis['with_media'] ?? 0), 'text-sky-200', 'fa-image') !!} {!! $pill('التعليقات', (int)($kpis['comments'] ?? 0), 'text-indigo-200', 'fa-comments') !!} {!! $pill('التفاعلات', (int)($kpis['reactions'] ?? 0), 'text-fuchsia-200', 'fa-heart') !!} {!! $pill('آخر نشاط', ($kpis['latest'] ?? '—'), 'text-emerald-200', 'fa-clock') !!} {!! $pill('الإجمالي', (int)($kpis['total'] ?? 0), 'text-white', 'fa-layer-group') !!}
{{-- Filters --}}
{{-- LIST --}} @if($posts->count())
@foreach($posts as $p) @php $isPinned = (bool)($p->is_pinned ?? false); $timeTxt = $p->formatted_time ?? optional($p->created_at)->format('Y-m-d H:i'); $content = trim((string)($p->content ?? '')); $hasMedia = (bool)($p->has_attachments ?? false); $imgs = (array)($p->attachment_urls ?? []); $reactionsCount = (int)($p->reactions_count ?? $p->reactions_count ?? 0); $commentsCount = (int)($p->comments_count ?? $p->comments_count ?? 0); @endphp
{{-- Header --}}
@if($isPinned) مثبّت @else منشور @endif @if($hasMedia) صور @endif
نُشر: {{ $timeTxt }}
رقم
#{{ $p->id }}
{{-- Content --}} @if($content !== '')
{{ $content }}
@endif {{-- Media --}} @if(!empty($imgs))
@foreach($imgs as $img)
فتح
@endforeach
@endif {{-- Social bar --}}
تفاعلات
{{ number_format($reactionsCount) }}
تعليقات
{{ number_format($commentsCount) }}
الحالة
نشط
إجراءات
{{-- رابط يفتح صفحة المنشورات ويركز على المنشور --}} {{-- placeholders (جاهزين للمستقبل) --}}
{{-- Mini comments preview (اختياري لو بترجع comments بالكنترول) --}} @if(isset($p->comments) && $p->comments->count())
آخر تعليقات
@foreach($p->comments as $c)
{{ $c->user?->name ?? 'عضو' }} {{ $c->formatted_time ?? optional($c->created_at)->diffForHumans() }}
{{ $c->content }}
@endforeach
التعليقات الكاملة من صفحة المنشورات العامة.
@endif
@endforeach
{{ $posts->withQueryString()->links() }}
@else
لا يوجد منشورات ضمن هذه الفلاتر.
@endif
@endsection