@php /** @var \Illuminate\Support\Collection $stabili */ /** @var \App\Models\Stabile|null $stabileAttivo */ $activeId = $stabileAttivo?->id; $stabileLabel = static function (?\App\Models\Stabile $stabile): string { if (! $stabile) { return ''; } $primary = trim((string) ($stabile->codice_operatore ?: $stabile->codice_stabile)); $mnemo = trim((string) ($stabile->cod_stabile ?? '')); if ($mnemo !== '' && $primary !== '' && $mnemo !== $primary) { return $mnemo . ' · ' . $primary; } return $primary !== '' ? $primary : ($mnemo !== '' ? $mnemo : ('#' . (string) $stabile->id)); }; @endphp
@if($stabileAttivo) @endif @if($stabili->count() > 1)
@csrf
@endif