@extends('layouts/default') @section('title') Discussion Forum @parent @stop @section('header_styles') @stop @section('content')

Discussion Forum

{{-- Fetch topics directly --}} @php $topics = DB::table('discusions')->get(); @endphp @foreach($topics as $topic)
{{ $topic->title }} Posted by {{ $topic->fullname ?? 'Admin' }} | {{ date('d M Y', strtotime($topic->created_at)) }}
{{-- Optional: fetch replies if you have a replies table --}} @php $replies = DB::table('discussion_replies')->where('topic_id', $topic->id)->get(); @endphp
@forelse($replies as $reply)
{{ $reply->fullname }}:

{{ $reply->message }}

{{ date('d M Y H:i', strtotime($reply->created_at)) }}
@empty

No replies yet. Be the first to reply!

@endforelse
{{-- Reply Form --}}
@csrf
@endforeach
@stop