@extends('layouts.app') @section('content')
Filtros de Búsqueda
@foreach ($customers as $customer) @php $last_contract = $customer->contracts->last(); $last_order = $customer->ordersPlaced()->get()->last(); $services = $last_order ? $last_order->services->pluck('name')->implode(', ') . ' (' . $last_order->programmed_date . ')' : 'Sin servicios'; $next_trackings = $customer->trackings ->where('next_date', '>=', now()->toDateString()) ->sortBy('next_date') ->values(); @endphp @endforeach
# Nombre Código Contacto Tipo Ultimo servicio realizado Proximo seguimiento Acciones
{{ $loop->iteration }} ({{ $customer->id }}) {{ $customer->name }} {{ $customer->code }} {{ $customer->contact_medium ? $contact_medium[$customer->contact_medium] : '-' }} {{ $customer->serviceType->name }} {{ $services }} {{ $next_trackings->isNotEmpty() ? $next_trackings->first()->service->name . ' (' . $next_trackings->first()->next_date . ')' : 'Sin seguimientos' }}
Analiticas
{{ $customers->links('pagination::bootstrap-5') }}
@include('dashboard.crm.modals.trackings') @endsection