@extends('backEnd.master') @section('title') @lang('common.forum_topic_details') @endsection @push('css') @endpush @section('mainContent')

{{ @$forum->createdBy->full_name }}

{{ dateconvert(@$forum->created_at) }}
@lang('common.category')

{{ @$forum->forumTitle->forumCategory->title }}

@lang('common.forum_title')

{{ @$forum->forumTitle->title }}

@lang('common.forum_topic')

{{ @$forum->title }}

{{-- @php $roleMap = [ 2 => 'Teacher', 3 => 'Admin', 4 => 'Student', 5 => 'Parent', 6 => 'Accountant', 7 => 'Receptionist', 8 => 'Librarian', 9 => 'Driver', ]; $availableFor = json_decode($forum->available_for, true); $authUserId = Auth::user()->id; @endphp @if ($forum->created_by == $authUserId)
@lang('common.available_for')
@foreach ($availableFor as $roleId) @endforeach
@endif --}}

{!! $forum->description !!}

@php $createdBy = $forum->created_by; $authUserId = auth()->user()->id; @endphp @if ($createdBy != $authUserId)
@endif

@lang('common.comments')

@foreach ($forum->forumComments as $comment)
@if ($comment->user) {{-- @if ($comment->user->role_id == 2) @elseif($comment->user->role_id == 3) @else --}} {{-- @endif --}} @endif

{{ @$comment->user->full_name }}

{{ dateconvert($comment->created_at) }}
@php $createdBy = $comment->user_id; $authUserId = auth()->user()->id; @endphp @if ($createdBy == $authUserId) @endif

{{ $comment->comment }}

@if ($createdBy != $authUserId)
@endif
@csrf

{{ __('common.write_your_reply') }}

@foreach ($comment->replies as $reply)
@if ($reply->user) {{-- @if ($reply->user->role_id == 2) @elseif($reply->user->role_id == 3) @else --}} {{-- @endif --}} @endif

{{ @$reply->user->full_name }}

{{ dateconvert($reply->created_at) }}
@php $createdBy = $reply->user_id; $authUserId = auth()->user()->id; @endphp @if ($createdBy == $authUserId) @endif

{{ $reply->reply }}

@if ($createdBy != $authUserId)
@endif
@endforeach
@endforeach
@csrf

{{ __('common.leave_a_comment') }}

{{ __('common.recent_discussion')}}

@foreach ($recent_forum as $r_forum)
{{ @$r_forum->title }}

{{ dateconvert(@$r_forum->created_at) }}


@endforeach
@endsection @include('backEnd.partials.data_table_js') @push('script') @endpush