@extends('layouts.dashboard.inface', ['section' => 'agents']) @section('content') @php $performance = $agent->performance; $fullName = trim(($agent->firstName ?? '').' '.($agent->lastName ?? '')) ?: 'Agente sin nombre'; $imageUrl = $agent->imageUrl ? (\Illuminate\Support\Str::startsWith($agent->imageUrl, ['http://', 'https://']) ? $agent->imageUrl : \Illuminate\Support\Facades\Storage::disk('public')->url($agent->imageUrl)) : null; $initials = mb_strtoupper(mb_substr($agent->firstName ?? 'A', 0, 1).mb_substr($agent->lastName ?? '', 0, 1)); $target = $performance['target'] ?? []; $pipelineColors = ['bg-blue-400', 'bg-sky-500', 'bg-indigo-500', 'bg-emerald-500']; @endphp
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@if ($imageUrl) {{ $fullName }} @else
{{ $initials }}
@endif

{{ $fullName }}

$agent->isActive, 'bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-300' => ! $agent->isActive, ])> {{ $agent->isActive ? 'Activo' : 'Inactivo' }}

{{ $agent->experienceLevel ?? 'Sin nivel asignado' }}

{{ implode(' · ', array_filter([ $agent->place, implode(', ', $performance['agencies'] ?? []), ])) ?: 'Sin ubicación o inmobiliaria asignada' }}

notification->any()) open @endif>
notifications_active

Enviar notificación personalizada

Se enviará a todos los dispositivos activos de {{ $fullName }} y quedará en su historial.

expand_more
@csrf
@error('title', 'notification')

{{ $message }}

@enderror
@error('message', 'notification')

{{ $message }}

@enderror

Puedes usar {nombre} y {nombre_completo} para personalizar el texto.

@foreach ([ ['label' => 'Ventas del año', 'value' => \Illuminate\Support\Number::currency((float) ($performance['year_sales'] ?? 0), in: 'MXN'), 'icon' => 'payments', 'tone' => 'text-blue-600 bg-blue-50 dark:bg-blue-900/30'], ['label' => 'Conversión', 'value' => number_format((float) ($performance['conversion'] ?? 0), 1).'%', 'icon' => 'percent', 'tone' => 'text-purple-600 bg-purple-50 dark:bg-purple-900/30'], ['label' => 'Prospectos activos', 'value' => number_format((int) ($performance['active_leads'] ?? 0)), 'icon' => 'group', 'tone' => 'text-orange-600 bg-orange-50 dark:bg-orange-900/30'], ['label' => 'Citas del mes', 'value' => number_format((int) ($performance['appointments_this_month'] ?? 0)), 'icon' => 'event_available', 'tone' => 'text-emerald-600 bg-emerald-50 dark:bg-emerald-900/30'], ] as $metric)

{{ $metric['label'] }}

{{ $metric['value'] }}

{{ $metric['icon'] }}
@endforeach

Meta mensual · {{ $target['label'] ?? '' }}

Meta: {{ $target['revenue_formatted'] ?? '$0.00' }}

{{ $target['achieved_formatted'] ?? '$0.00' }}

{{ number_format((float) ($target['progress'] ?? 0), 1) }}% completado

{{ $target['period_start'] ?? '' }} {{ $target['period_end'] ?? '' }}
any()) open @endif>

Configurar metas del agente

Define objetivos mensuales de prospección, ventas y cobranza.

expand_more
@csrf
@error('month')

{{ $message }}

@enderror
@error('target_leads')

{{ $message }}

@enderror
@error('target_appointments')

{{ $message }}

@enderror
@error('target_units_sold')

{{ $message }}

@enderror
@error('target_revenue')

{{ $message }}

@enderror
@error('target_collection')

{{ $message }}

@enderror

Ventas de los últimos 6 meses

@foreach ($performance['monthly_sales'] ?? [] as $month)
{{ $month['label'] }}
@endforeach

Embudo de conversión

@foreach ($performance['pipeline'] ?? [] as $index => $stage)
{{ $stage['label'] }} ({{ $stage['count'] }}) {{ $stage['percentage'] }}%
@endforeach

Cartera asignada

Prospectos vinculados con este agente.

Agregar prospecto
@forelse ($performance['portfolio'] ?? [] as $lead) @empty @endforelse
Prospecto Interés Estatus Último contacto

{{ $lead['name'] }}

{{ $lead['email'] }}

{{ $lead['interest'] }} {{ $lead['status'] }} {{ $lead['last_contact'] ? \Carbon\Carbon::parse($lead['last_contact'])->format('d/m/Y') : 'Sin actividad' }} Ver
Este agente todavía no tiene prospectos asignados.
@endsection