{{-- Client --}}
Client

{{-- Devis (masqué si vide, ex. chantiers intervention) --}} @if (!empty($devisList) && is_array($devisList))
Devis
@foreach ($devisList as $devis)
  • N° : {{ $devis['id'] ?? '—' }}
  • Nature : {{ $devis['nature'] ?? '—' }}
  • Adresse chantier : {{ $devis['adresse_1'] ?? '—' }} {{ $devis['adresse_2'] ?? '—' }}
  • Code Postal : {{ $devis['code_postal'] ?? '—' }}
  • Ville : {{ $devis['ville'] ?? '—' }}
  • Responsable : {{ $devis['responsable'] ?? '—' }}
@endforeach @endif {{-- Interventions (masqué si vide, ex. chantiers pose/maçonnerie) --}} @if (!empty($interventionsList) && is_array($interventionsList))
Interventions
@foreach ($interventionsList as $inter) @php $clientInter = $inter['CLIENT'] ?? null; $nomClientInter = $clientInter['RAISON_SOCIALE'] ?? trim(($clientInter['NOMFAMILLE'] ?? '') . ' ' . ($clientInter['PRENOM'] ?? '')) ?: '—'; $adresseInter = trim( ($clientInter['ADRESSEP1'] ?? '') . ' ' . ($clientInter['CPOSTALP'] ?? '') . ' ' . ($clientInter['VILLEP'] ?? '') ); @endphp
  • N° : {{ $inter['IDINTERVENTION'] ?? '—' }}
  • Libellé : {{ $inter['LIBINTER'] ?? '—' }}
  • Secteur : {{ $inter['SECTEUR'] ?? '—' }}
  • Client : {{ $nomClientInter }}
  • @if ($adresseInter)
  • Adresse : {{ $adresseInter }}
  • @endif
@endforeach @endif
{{-- Infos planning --}}
Chantier
@php // dates API = string -> Carbon $debut = !empty($planning['date_debut']) ? \Illuminate\Support\Carbon::parse($planning['date_debut']) : null; $fin = !empty($planning['date_fin']) ? \Illuminate\Support\Carbon::parse($planning['date_fin']) : null; $equipeNom = $planning['equipe']['nom'] ?? '—'; @endphp
{{-- Techniciens --}}
Techniciens
@php // selon ton API : "employes" OU "employes" / "users" -> toi c'est "employes" $employes = $planning['employes'] ?? []; @endphp @if (!empty($employes) && is_array($employes)) @else

Aucun technicien affecté.

@endif {{-- Observations : ton API ne renvoie pas ça actuellement --}} {{-- Si tu ajoutes observations dans l'API, tu pourras réactiver --}} @if (!empty($planning['observations']) && is_array($planning['observations']))
Observations

@endif
{{-- Bouton EDIT --}} @php $isIntervention = in_array($equipeType ?? '', ['intervention']); $editUrl = $isIntervention ? route('plannings.interventions.edit', $planning['id']) : route('plannings.chantiers.edit', $planning['id']); $editPerm = $isIntervention ? 'plannings.editIntervention' : 'plannings.editChantier'; @endphp @can($editPerm) @endcan @can('plannings.delete')
@csrf @method('DELETE')
@endcan