{{-- The customer-facing conversation on a support token. Every message lives in the same `token_notes` thread the admin panel writes to. A message carrying a client_id was posted here from the portal; one carrying a user_id was written by staff. Only note_type = 'customer' rows reach this partial โ€” the portal controllers constrain the relation, so internal employee notes can never appear. Usage: @include('Customer.tokenNotes', ['token' => $r]) --}} @once @endonce @php $threadNotes = $token->notes; @endphp
@if ($threadNotes->isEmpty())
No messages yet.
@else
@foreach ($threadNotes as $note) {{-- update_time is deliberately not shown here. It is an internal follow-up deadline that drives the Telegram escalation and the token dashboard's "no update" buckets, not a fact about the message โ€” and showing a customer a promised time they can hold you to (or watch expire) is worse than showing nothing. It stays visible in the admin note modal. --}}
{{ $note->note }}
{{ $note->author_side === 'client' ? 'You' : $note->author_name }} ยท {{ date('d-M-Y g:i a', strtotime($note->created_at)) }}
@endforeach
@endif {{-- The same setting that hides the token's category and description also takes away the reply box, so the thread stays read-only for the customer. replyTokenNote() refuses the post for the same reason. --}} @if ($token->status == 'Active' && !globalPermission('hide-token-details-in-customer-portal'))
@csrf {{-- Scoped by token id so a validation message shows only on the thread it belongs to, not on every row in the table. --}} @if ($errors->has('note') && (int) old('token_id') === (int) $token->id)
{{ $errors->first('note') }}
@endif @if (session('note_reply_success') == $token->id)
Reply sent.
@endif
@endif