@section('title', ($agent->name ?? 'Agent') . ' — Real Estate Agent') @push('styles') @endpush @section('content') {{-- ─── Agent Hero ──────────────────────── --}}
@php $agentUser = $agent->user ?? null; $agentName = $agent->business_name ?? $agentUser->name ?? $agent->name ?? 'Agent'; $avatarUrl = \App\Helpers\StorageHelper::url( $agentUser?->profile_photo_path ?: ($agent->profile_photo_path ?? null), 'https://ui-avatars.com/api/?name='.urlencode($agentName).'&size=240&background=1e3a5f&color=fff' ); @endphp {{ $agentName }}
{{ $agentName }}
{{ $agent->tagline ?? 'Verified Real Estate Agent' }}
@for($s=1;$s<=5;$s++) @endfor ({{ $agent->ratingSummary->total_reviews ?? 0 }} reviews)
{{ $properties->total() ?? 0 }}
Active Listings
{{ number_format($agent->ratingSummary->average_rating ?? 0, 1) }}
Avg Rating
{{ $followersCount ?? 0 }}
Followers
@auth @else @endauth
{{-- ─── Body ─────────────────────────── --}}
{{-- Listings --}}
Active Listings ({{ $properties->total() ?? $properties->count() }})
@forelse($properties as $property) @empty

No active listings at this time.

@endforelse
@if(method_exists($properties,'hasPages') && $properties->hasPages()) @endif {{-- Reviews --}}
Agent Reviews ({{ $reviews->total() ?? $reviews->count() }})
@forelse($reviews as $review)
@php $reviewUser = $review->user ?? null; $reviewUserName = $reviewUser->name ?? 'User'; $rAvatar = \App\Helpers\StorageHelper::url( $reviewUser?->profile_photo_path, 'https://ui-avatars.com/api/?name='.urlencode($reviewUserName).'&size=88&background=1e3a5f&color=fff' ); @endphp {{ $reviewUserName }}
{{ $reviewUserName }}
@for($s=1;$s<=5;$s++) @endfor
{{ $review->created_at->diffForHumans() }}
@if($review->title)
{{ $review->title }}
@endif
{{ $review->body }}
@empty

This agent doesn't have any reviews yet.

@endforelse
@if(method_exists($reviews,'hasPages') && $reviews->hasPages()) @endif
{{-- Sidebar --}}
{{-- Bio --}}
About This Agent
{{ $agent->bio ?? 'Experienced real estate professional dedicated to helping clients find their perfect property.' }}
{{-- Location --}} @if($agent->city || $agent->address)
Office Location
{{ implode(', ', array_filter([$agent->address, $agent->city])) }}
@endif {{-- Certifications & Licenses --}} @if(!empty($agent->certifications) && is_array($agent->certifications))
Certifications & Licenses
@foreach($agent->certifications as $cert) @if(filled($cert))
{{ $cert }}
@endif @endforeach
@endif {{-- Contact Info --}} @php $agentEmail = $agent->user?->email ?? null; $agentPhone = $agent->phone ?? $agent->user?->phone ?? null; if (!function_exists('maskEmailLocal')) { function maskEmailLocal(?string $email): string { if (!$email) return ''; $parts = explode('@', $email); $name = $parts[0]; $domain = $parts[1] ?? ''; $len = strlen($name); $masked = $len > 2 ? substr($name, 0, 2) . str_repeat('*', max(3, $len - 2)) : $name . '***'; return $masked . '@' . $domain; } } if (!function_exists('maskPhoneLocal')) { function maskPhoneLocal(?string $phone): string { if (!$phone) return ''; $cleaned = preg_replace('/[^\d+]/', '', $phone); $len = strlen($cleaned); if ($len <= 4) return '******'; return substr($cleaned, 0, 3) . str_repeat('*', max(4, $len - 5)) . substr($cleaned, -2); } } @endphp
Contact Information
{{-- Email --}} @if($agentEmail)
Email Address
@auth {{ $agentEmail }} @else {{ maskEmailLocal($agentEmail) }} @endauth
@endif {{-- Phone --}} @if($agentPhone)
Contact Number
@auth {{ $agentPhone }} @else {{ maskPhoneLocal($agentPhone) }} @endauth
@endif @if(!$agentEmail && !$agentPhone)
No contact details provided.
@endif
@if($agent->user_id) @endif @endsection @push('scripts') @endpush