@foreach($this->getFilteredUsers() as $user) @endforeach @if(count($this->getFilteredUsers()) === 0)

No users found

@endif
@foreach($this->getFilteredChats() as $chat) @endforeach @if(count($this->getFilteredChats()) === 0)

No chats found

@endif
@if($selectedChat || $selectedUserId)
@if($selectedChat)
{{ $selectedChat->name ?? ($selectedChat->classSection?->name . ' Chat') }}
{{ $selectedChat->participants->count() }} participants
@elseif($selectedUserId) @php $selectedUser = collect($users)->firstWhere('id', $selectedUserId); @endphp @if($selectedUser) {{ $selectedUser['name'] }}
{{ $selectedUser['name'] }}
@if($selectedUser['is_available'] === true) Available @elseif($selectedUser['is_available'] === false) Not available @else {{ ucfirst($selectedUser['role']) }} @endif
@endif @endif
@foreach($messages as $message)
{{ $message['user_name'] }}

{{ $message['message'] }}

{{ \Carbon\Carbon::parse($message['created_at'])->format('H:i') }} @if($message['is_edited']) (edited) @endif
@endforeach @if(count($messages) === 0)

No messages yet. Start the conversation!

@endif
Send
@else

Select a user or chat to start messaging

Choose someone from the sidebar to begin a conversation

@endif
@script @endscript