@extends('Layouts.app') @section('content')
{{-- Forum Header --}}

Forum Diskusi

{{ $meeting->title }}

{{ $meeting->description }}

{{-- Conditional Post Creation Form (Visible only to authenticated users) --}} @auth

Buat Postingan Baru

@csrf
@endauth {{-- Posts List --}}
@forelse($posts as $post)
{{-- Post Details --}}

{{ $post->title }}

{{ $post->body }}

{{ $post->user->nama }} {{ $post->created_at->diffForHumans() }}
{{-- Comments Section --}}

Komentar ({{ $post->comments->count() }})

@foreach($post->comments as $comment)

{{ $comment->user->nama }}

{{ $comment->body }}

{{ $comment->created_at->diffForHumans() }} {{-- Conditional Delete Button for the comment owner --}} @if(Auth::check() && Auth::user()->id_user === $comment->user_id) @endif
@endforeach
{{-- Comment Form (AJAX) --}} @auth
@csrf
@else

Masuk untuk menulis komentar.

@endauth
@empty

Belum ada postingan di forum ini. Jadilah yang pertama!

@endforelse
@endsection @push('scripts') @endpush