@extends('layouts.app') @section('title', 'Mes Messages - CayorCity') @section('content')

@if(auth()->user()->is_agency && auth()->user()->agency) Messages Reçus @else Mes Messages Envoyés @endif

Retour Dashboard
@if(session('success')) @endif

{{ $contacts->total() }}

Total Messages
@if(auth()->user()->is_agency && auth()->user()->agency)

{{ $contacts->where('read_at', null)->count() }}

Non Lus

{{ $contacts->where('read_at', '!=', null)->count() }}

Lus
@endif
@if(auth()->user()->is_agency && auth()->user()->agency) Messages reçus pour vos propriétés @else Messages que vous avez envoyés @endif
@forelse($contacts as $contact)
@if(auth()->user()->is_agency && auth()->user()->agency) {{ $contact->name }} @else {{ $contact->property->title }} @endif
@if(!$contact->read_at && auth()->user()->is_agency && auth()->user()->agency) Nouveau @elseif($contact->read_at) Lu @endif
@if(auth()->user()->is_agency && auth()->user()->agency) {{ $contact->email }} @if($contact->phone) {{ $contact->phone }} @endif
{{ $contact->property->title }} @else @if($contact->property->agency) {{ $contact->property->agency->name }} @endif
Envoyé à : {{ $contact->property->agency->email ?? $contact->property->user->email }} @endif

{{ $contact->message }}

{{ $contact->created_at->format('d/m/Y à H:i') }} @if($contact->read_at) Lu le {{ $contact->read_at->format('d/m/Y à H:i') }} @endif
@if(auth()->user()->is_agency && auth()->user()->agency)
@if(!$contact->read_at)
@csrf @method('PATCH')
@endif Répondre par Email @if($contact->phone) Appeler @endif
@else
Voir la propriété @if($contact->property->agency && $contact->property->agency->phone)

Contacter l'agence @endif
@endif
@empty
Aucun message trouvé

@if(auth()->user()->is_agency && auth()->user()->agency) Aucun message reçu pour vos propriétés pour le moment. @else Vous n'avez envoyé aucun message pour le moment.
Parcourir les propriétés @endif

@endforelse @if($contacts->hasPages())
{{ $contacts->links() }}
@endif
@endsection @section('scripts') @endsection