@extends('layouts.app') @section('title', 'Messages — Tenseal') @push('styles') @endpush @section('content')

Messages

{{ $transactions->total() }} conversation{{ $transactions->total() !== 1 ? 's' : '' }}
@if($transactions->count() > 0)
@foreach($transactions as $tx) @php $otherUser = $tx->buyer_id === auth()->id() ? $tx->seller : $tx->buyer; $lastMsg = $tx->messages->first(); @endphp
{{ strtoupper(substr($otherUser->name ?? 'U', 0, 1)) }}
{{ $otherUser->name ?? 'Unknown User' }} @if($lastMsg) {{ $lastMsg->created_at->diffForHumans(null, true, true) }} @endif
@if($lastMsg)
@if($lastMsg->sender_id === auth()->id()) You: @endif {{ Str::limit($lastMsg->content, 80) }}
@endif
{{ Str::limit($tx->title ?? 'Transaction #' . $tx->id, 30) }} ₦{{ number_format($tx->amount, 2) }}
@if($tx->unread_count > 0) {{ $tx->unread_count }} @endif
@endforeach
@include('partials.table-pagination', ['paginator' => $transactions, 'label' => 'conversations']) @else

No messages yet

When you start a transaction, you can message the buyer or seller here.

@endif @endsection