@extends('admin.layouts.layout') @section('title', 'View Agent: ' . $agent->first_name . ' ' . $agent->last_name) @section('content')

View Agent: {{ $agent->first_name }} {{ $agent->last_name }}

@if($permission['edit'] ?? true) Edit Agent @endif @if($permission['index'] ?? true) Back to Agent List @endif
Agent Details
@php $avatarThumb = isset($agent->avatar['thumb']) ? $agent->avatar['thumb'] : asset('img/200x200/no-profile.jpg'); @endphp Profile
Username: {{ $agent->username ?? 'N/A' }}
First Name: {{ $agent->first_name ?? 'N/A' }}
Last Name: {{ $agent->last_name ?? 'N/A' }}
Company Name: {{ isset($agent->agencies['name']) ? $agent->agencies['name'] : 'N/A' }}
Email Address: {{ $agent->email ?? 'N/A' }}
Secondary Email: {{ $agent->secondary_email ?? 'N/A' }}
Phone: @php $phone = $agent->phone ?? ''; if (preg_match('/^(\d{10})$/', $phone)) { $formattedPhone = '(' . substr($phone, 0, 3) . ') ' . substr($phone, 3, 3) . '-' . substr($phone, 6); } else { $formattedPhone = $phone ?: 'N/A'; } @endphp {{ $formattedPhone }}
Fax: {{ $agent->fax ?? 'N/A' }}
Birth date: @if($agent->dob) {{ \Carbon\Carbon::parse($agent->dob)->format('m-d-Y') }} @else N/A @endif
Address: {{ isset($agent->addresses['address_line1']) ? $agent->addresses['address_line1'] : 'N/A' }}
State: {{ $agent->addresses['state'] ?? 'N/A' }}
Zip: {{ $agent->addresses['zip'] ?? 'N/A' }}
Notification Preference: {{ $agent->notification_preference ?? 'N/A' }}
Sponsor: @if($agent->sponsors && $agent->sponsors->count() > 0) @foreach($agent->sponsors as $sponsor) {{ $sponsor->first_name }} {{ $sponsor->last_name }} @endforeach @else N/A @endif
Note: {{ $agent->note ?? 'N/A' }}
Status: @if($agent->status == 1) Active @else Inactive @endif
@endsection @push('page_css') @endpush