@extends('layouts.app') @section('title', 'Support - Tiqkets') @section('page-title', 'Support') @push('styles') @endpush @section('content')
@if (Auth::user()->role != 1) @if ($sidebarusers->isNotEmpty())
Available Support Admins
@foreach ($sidebarusers as $admin)
{{ $admin->name }}
{{ $admin->name }} SUPPORT
Click to start conversation
@endforeach @endif @if ($conversations->isNotEmpty())
Your Conversations
@foreach ($conversations as $conversation) @php $otherUser = $conversation->supportAdmin; $latestMsg = $conversation->latestMessage; @endphp
{{ $otherUser->name ?? 'Support' }}
{{ $otherUser->name ?? 'Support' }} @if ($latestMsg) {{ $latestMsg->created_at->format('d M, h:i A') }} @endif
{{ $latestMsg ? Str::limit($latestMsg->message, 40) : 'No messages yet' }}
@endforeach @endif @else @if ($conversations->isEmpty())
No user conversations yet
@else @foreach ($conversations as $conversation) @php $otherUser = $conversation->user; $latestMsg = $conversation->latestMessage; @endphp
{{ $otherUser->name ?? 'User' }}
{{ $otherUser->name ?? 'User' }} @if ($latestMsg) {{ $latestMsg->created_at->format('d M, h:i A') }} @endif
{{ $latestMsg ? Str::limit($latestMsg->message, 40) : 'No messages yet' }}
@endforeach @endif @endif
@if (Auth::user()->role == 1) Select a user conversation to start chatting @else Select a support admin from the list to start chatting @endif
@endsection @push('scripts') @endpush