2025-11-06 17:09:52 +05:30
|
|
|
@extends('admin.layouts.app')
|
|
|
|
|
|
2026-02-17 14:32:48 +05:30
|
|
|
@section('page-title', 'Chat Support')
|
2025-11-06 17:09:52 +05:30
|
|
|
|
|
|
|
|
@section('content')
|
2026-02-17 14:32:48 +05:30
|
|
|
|
|
|
|
|
<div class="container py-4">
|
|
|
|
|
|
|
|
|
|
<h2 class="mb-4 fw-bold">Customer Support Chat</h2>
|
|
|
|
|
|
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
|
<div class="card-body p-0">
|
|
|
|
|
|
|
|
|
|
@if($tickets->count() === 0)
|
|
|
|
|
<div class="p-4 text-center text-muted">
|
|
|
|
|
<h5>No customer chats yet.</h5>
|
|
|
|
|
</div>
|
|
|
|
|
@else
|
|
|
|
|
<ul class="list-group list-group-flush">
|
|
|
|
|
|
|
|
|
|
@foreach($tickets as $ticket)
|
|
|
|
|
@php
|
|
|
|
|
// Get last message
|
|
|
|
|
$lastMsg = $ticket->messages()->latest()->first();
|
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
|
|
<li class="list-group-item py-3">
|
|
|
|
|
|
|
|
|
|
<div class="d-flex align-items-center justify-content-between">
|
|
|
|
|
|
|
|
|
|
<!-- Left side: User info + last message -->
|
|
|
|
|
<div class="d-flex align-items-center gap-3">
|
|
|
|
|
|
|
|
|
|
<!-- Profile Circle -->
|
|
|
|
|
<div class="rounded-circle bg-primary text-white d-flex align-items-center justify-content-center"
|
|
|
|
|
style="width: 45px; height: 45px; font-size: 18px;">
|
|
|
|
|
{{ strtoupper(substr($ticket->user->customer_name ?? $ticket->user->name, 0, 1)) }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<!-- Customer Name -->
|
|
|
|
|
<h6 class="mb-1 fw-semibold">
|
|
|
|
|
{{ $ticket->user->customer_name ?? $ticket->user->name }}
|
|
|
|
|
</h6>
|
|
|
|
|
|
|
|
|
|
<!-- Last message preview -->
|
|
|
|
|
<small class="text-muted">
|
|
|
|
|
@if($lastMsg)
|
|
|
|
|
@if($lastMsg->message)
|
|
|
|
|
{{ Str::limit($lastMsg->message, 35) }}
|
|
|
|
|
@elseif($lastMsg->file_type === 'image')
|
|
|
|
|
📷 Image
|
|
|
|
|
@elseif($lastMsg->file_type === 'video')
|
|
|
|
|
🎥 Video
|
|
|
|
|
@else
|
|
|
|
|
📎 Attachment
|
|
|
|
|
@endif
|
|
|
|
|
@else
|
|
|
|
|
<i>No messages yet</i>
|
|
|
|
|
@endif
|
|
|
|
|
</small>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Right Side: Status + Button -->
|
|
|
|
|
<div class="text-end">
|
|
|
|
|
|
|
|
|
|
<!-- Ticket Status -->
|
|
|
|
|
<span class="badge
|
|
|
|
|
{{ $ticket->status === 'open' ? 'bg-success' : 'bg-danger' }}">
|
|
|
|
|
{{ ucfirst($ticket->status) }}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<!-- Open Chat Button -->
|
|
|
|
|
<a href="{{ route('admin.chat.open', $ticket->id) }}"
|
|
|
|
|
class="btn btn-sm btn-primary ms-2">
|
|
|
|
|
Open Chat →
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-06 17:09:52 +05:30
|
|
|
</div>
|
2026-02-17 14:32:48 +05:30
|
|
|
|
2025-11-06 17:09:52 +05:30
|
|
|
@endsection
|