{{-- resources/views/dashboard.blade.php — Dashboard principale @extends indica da quale layout "ereditare" la struttura HTML. @section riempie le sezioni definite con @yield nel layout. --}} @extends('layouts.app') @section('title', 'Dashboard') @section('page-title', 'Dashboard') @section('page-actions') Nuovo Cliente @endsection @section('content') {{-- Messaggio di benvenuto --}} @if ($welcomeMessage)
{{ $welcomeMessage }}
@endif {{-- ═══ Statistiche ═══════════════════════════════════════════════════ --}}
{{ $stats['total'] }}
Clienti totali
{{ $stats['active'] }}
Clienti attivi
{{ $stats['prospect'] }}
Prospect
{{-- number_format: formatta il numero con separatori --}}
{{ $appSettings['currency_symbol'] }}{{ number_format($stats['total_contract_value'], 0, ',', '.') }}
Valore contratti
{{-- ═══ Clienti recenti + Distribuzione per città ══════════════════════ --}}
{{-- Ultimi clienti aggiunti --}}
Clienti recenti
{{-- @forelse: come @foreach ma gestisce il caso lista vuota --}} @forelse ($recentCustomers as $customer) @empty @endforelse
Cliente Tipo Stato Aggiunto
{{ $customer->name }}
{{ $customer->email }}
{{ $customer->type_label }} {{-- badge_color è l'accessor definito nel Model --}} {{ ucfirst($customer->status) }} {{-- diffForHumans(): "2 giorni fa", "stamattina", ecc. --}} {{ $customer->created_at->diffForHumans() }}
Nessun cliente ancora. Aggiungine uno!
{{-- Clienti per città --}}
Top città
@forelse ($byCity as $city => $count)
{{ $city ?: 'N/D' }}
@php $maxCount = max(array_values($byCity)); $pct = $maxCount > 0 ? ($count / $maxCount) * 100 : 0; @endphp
{{ $count }}
@empty

Nessun dato disponibile

@endforelse
@endsection