@extends('layouts.admin') @section('title', 'Agentes - ' . $agency->name) @section('content') @php $isAgencyAdmin = auth()->user()->hasRole('agency_admin'); $isRootOrDev = auth()->user()->hasRole(['root', 'developer']); $canManage = $isRootOrDev || $isAgencyAdmin; @endphp

Agentes de {{ $agency->name }}

@if($canManage) Crear Agente @endif @if($isRootOrDev) Volver a Agencias @endif
@if(session('message'))
{{ session('message') }}
@endif {{-- Logo de la Agencia --}} @if($agency->logo)
Logo de {{ $agency->name }}
{{ $agency->name }}
@if($agency->city) {{ $agency->city }} @endif
@endif
@forelse($agents as $agent)
{{-- Foto del Agente --}}
@if($agent->photo_file) Foto de {{ $agent->full_name }} @else
@endif
{{ $agent->full_name }}

@if($agent->position) {{ $agent->position }} @endif

@if($agent->email) {{ $agent->email }} @endif

@if($agent->phone) {{ $agent->phone }} @endif

@if($agent->has_license) Licencia: {{ $agent->license_number }} @endif
{{ $agent->active ? 'Activo' : 'Inactivo' }}
@if($canManage)
@csrf @method('DELETE')
@endif
@empty

No hay agentes registrados aún.

@if($canManage) Crear primer agente @endif
@endforelse
@endsection