@php
$logoOuvrage1 = null;
$logoOuvrage2 = null;
foreach($panneau->intervenants->sortBy('numeroOrdre') as $intervenant) {
if($intervenant->numeroOrdre == 1 && Str::contains(strtolower($intervenant->type), 'ouvrage')) {
$logoOuvrage1 = $intervenant->logo;
$logoOuvrage2 = $intervenant->logo2;
break;
}
}
@endphp
@php
$titre = $panneau->nom ?? null;
$logo = $panneau->logo ?? null;
@endphp
@if($logoOuvrage1)
@endif
@if($titre || $logo)
@if($logo)
@else
{{$titre}}
@endif
@endif
@if($logoOuvrage2)
@endif
@if($panneau->sousTitre)
{{ $panneau->sousTitre }}
@endif
@php
$nombreIntervenants = $panneau->intervenants->count();
$typesAffiches = ['ouvrage', 'oeuvre', 'archi', 'SPS', 'controle'];
@endphp
@foreach($panneau->intervenants->sortBy('numeroOrdre') as $intervenant)
@if(collect($typesAffiches)->contains(function($type) use ($intervenant) {
return Str::contains(strtolower($intervenant->type), strtolower($type));
}))
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@php
$showLogo2 = false;
if($intervenant->numeroOrdre == 1 && Str::contains(strtolower($intervenant->type), 'ouvrage')) $showLogo2 = true;
@endphp
{{-- Logo 1 : si seul → on le pousse à droite (ms-auto), si duo → on garde la grille normale --}}
@if(!empty($intervenant->logo))
@endif
{{-- Logo 2 --}}
@if($showLogo2 && !empty($intervenant->logo2))
@endif
@endif
@endforeach
Pour accéder à l'ensemble des informations du chantier : SCANNEZ-MOI !
@if($panneau->qrLink)
{!! \SimpleSoftwareIO\QrCode\Facades\QrCode::size(315)->generate(route('qr.redirect', $panneau->qrLink->slug)) !!}
@endif
@php
$hasLabels = $panneau->labels->where('actif', true)->isNotEmpty();
@endphp
@if(isset($panneau->permis))
{{ $panneau->permis->type }} N° {{ $panneau->permis->numero }}
@endif
@if($hasLabels)
@foreach($panneau->labels->where('actif', true) as $label)
@endforeach
@endif