@extends('layouts.student_dashboard') @section('content')
Current Chat
Private Conversation
@if(isset($conversation->other_participant_name))
{{ substr($conversation->other_participant_name, 0, 1) }}
{{ $conversation->other_participant_name }} {{ $conversation->other_participant_type === 'staff' ? 'Staff Member' : 'Student' }}
@endif

Private Chat

Private
{{ isset($conversation->other_participant_name) ? substr($conversation->other_participant_name, 0, 1) : 'U' }}
@if(isset($conversation->other_participant_name)) {{ $conversation->other_participant_name }} @else Unknown User @endif {{ $conversation->other_participant_type === 'staff' ? 'Staff Member' : 'Student' }}
@if($messages->count() > 0) @foreach($messages as $message) @php $isOwn = ($message->sender_id == session('student.id') && $message->sender_type == 'student'); if ($message->sender_type === 'staff') { $staff = \App\Models\Staff::find($message->sender_id); $senderName = $staff ? $staff->name : 'Unknown Staff'; } else { $student = \App\Models\Student::find($message->sender_id); $senderName = $student ? $student->name : 'Unknown Student'; } @endphp
{{ substr($senderName, 0, 1) }}
{{ $senderName }} {{ $message->created_at->format('h:i A') }}

{{ $message->message }}

@if($message->hasAttachment()) @endif
@endforeach @else

No messages yet

Start the conversation by sending a message

@endif
@csrf
@endsection