@extends('layouts.app') @section('title', $broker->name . ' — Broker') @section('content') {{-- Header --}}

{{ $broker->name }}

@if($broker->is_active) Active @else Inactive @endif
Edit @if(Auth::user()->isAdmin())
@csrf @method('PATCH')
@endif
{{-- Left: Firm details --}}
Firm Details
Broker Name
{{ $broker->name }}
Primary Mobile
{{ $broker->mobile }}
@if($broker->email)
Email
{{ $broker->email }}
@endif
Operating Area
{{ $broker->operating_area ?? '—' }}
Added by
{{ optional($broker->createdBy)->name ?? '—' }}
Added on
{{ $broker->created_at->format('d M Y') }}
{{-- Contact Persons --}}
Contact Persons {{ $broker->contactPersons->count() }}
@if($broker->contactPersons->isEmpty())
No contact persons added.
@else
@foreach($broker->contactPersons as $contact) @endforeach
Name Mobile Role
{{ $contact->name }} {{ $contact->mobile }} {{ $contact->role ?? '—' }}
@endif
{{-- Right: Sourced Properties --}}
Properties Sourced {{ $properties->count() }}
@if($properties->isEmpty())
No properties linked to this broker yet.
@else
@foreach($properties as $property) @php $statusMap = [ 'published' => ['bg-success-subtle text-success', 'Published'], 'under_review' => ['bg-warning-subtle text-warning', 'Under Review'], 'unavailable' => ['bg-secondary-subtle text-secondary', 'Unavailable'], ]; $statusStyle = $statusMap[$property->status] ?? ['bg-light text-muted', ucfirst($property->status)]; $purposeMap = \App\Models\Property::LISTING_PURPOSES; @endphp @endforeach
Property Owner Purpose Status
{{ $property->title }}
@if($property->city)
{{ $property->city }}
@endif
{{ optional($property->owner)->name ?? '—' }} {{ $purposeMap[$property->listing_purpose] ?? $property->listing_purpose }} {{ $statusStyle[1] }}
@endif
@endsection