{{-- resources/views/chat/show.blade.php --}} @extends('chat.layout') @section('title', 'Carisma') @section('page-name', 'Carisma') @section('page-detail', $conversation->type === 'group' ? $conversation->name : 'Chat') @section('custom-styles') @endsection @section('body') @php // Get the authenticated user and tenant from middleware-set attributes $authenticatedUser = request()->attributes->get('authenticated_user'); $currentUserId = null; $currentUserType = null; if (get_class($authenticatedUser) === 'App\Models\Admin') { $currentUserId = $authenticatedUser->id; $currentUserType = 'admin'; } else { $currentUserId = $authenticatedUser->employee_id ?? null; $currentUserType = 'employee'; } $currentTenantId = request()->attributes->get('tenant_id'); @endphp
@php $allParticipants = $conversation->getAllParticipants(); @endphp @foreach($allParticipants->take(3) as $participant) {{ $participant->participant_type === 'admin' ? 'Admin: ' . $participant->display_name : $participant->name }}@if(!$loop->last), @endif @endforeach @if($allParticipants->count() > 3) , +{{ $allParticipants->count() - 3 }} more @endif
online
{{ $participantName }} @if($isCurrentUser) (You) @endif