@extends('layouts.admin') @section('title', 'Ticket #' . $ticket->reference) @push('styles') @endpush @section('content')
@csrf
@csrf

Conversation

{{ $ticket->messages->count() }} message{{ $ticket->messages->count() !== 1 ? 's' : '' }}
@forelse($ticket->messages as $message)
{{ strtoupper(substr($message->user->name ?? ($message->is_admin ? 'A' : 'U'), 0, 1)) }}
{{ $message->user->name ?? ($message->is_admin ? 'Admin' : 'User') }} {{ $message->created_at->format('M d, H:i') }}
{!! nl2br(e($message->body)) !!}
@if($message->attachment) @endif
@empty

No messages yet. Start the conversation by sending a reply below.

@endforelse
User is typing...
@csrf
{{-- Customer context — populated by SupportController@show. Lets the support agent answer the ticket without opening 6 other tabs. --}} @if(! empty($context))

Customer Context

{{-- Account flags --}}
@if($context['is_verified']) KYC verified @else KYC: {{ str_replace('_', ' ', $context['kyc_status']) }} @endif @if($context['recent_payment_failures'] > 0) {{ $context['recent_payment_failures'] }} failed payment(s) 30d @endif @if($context['role'] !== 'user') {{ str_replace('_', ' ', $context['role']) }} @endif
{{-- Wallet --}} @if($context['wallet_balance'] !== null)
Wallet
{{ $context['wallet_currency'] }} {{ number_format((float) $context['wallet_balance'], 2) }}
@if((float) $context['wallet_held'] > 0)
{{ number_format((float) $context['wallet_held'], 2) }} held in escrow
@endif
@endif {{-- Account age + last login --}} @if($context['created_at'])
Member since {{ \Carbon\Carbon::parse($context['created_at'])->diffForHumans() }}
@endif @if($context['last_login_at'])
Last login {{ \Carbon\Carbon::parse($context['last_login_at'])->diffForHumans() }}
@endif {{-- Inventory tenants --}} @if($context['tenants']->isNotEmpty())
Inventory Tenants
@foreach($context['tenants'] as $t)
{{ $t->name }} {{ ucfirst($t->plan ?? 'free') }} · {{ $t->status }}
@endforeach
@endif {{-- Recent escrows --}} @if($context['recent_escrows']->isNotEmpty())
Recent Escrows
@foreach($context['recent_escrows'] as $tx)
{{ \Illuminate\Support\Str::limit($tx->title, 40) }} ₦{{ number_format($tx->amount, 0) }}
{{ ucfirst($tx->status) }} · {{ $tx->created_at->diffForHumans() }}
@endforeach
@endif @if(\Illuminate\Support\Facades\Route::has('admin.users.show')) View full profile → @endif
@endif

Ticket Information

Reference {{ $ticket->reference }}
User
{{ $ticket->user->name ?? 'N/A' }}
{{ $ticket->user->email ?? '' }}
Module {{ ucfirst($ticket->module ?? 'general') }}
Category {{ ucfirst($ticket->category ?? 'General') }}
Priority {{ ucfirst($ticket->priority ?? 'normal') }}
Status {{ str_replace('_', ' ', ucfirst($ticket->status)) }}
Created {{ $ticket->created_at->format('M d, Y H:i') }}
Assigned To {{ $ticket->assignee?->name ?? 'Unassigned' }}
@endsection @push('scripts') @endpush