@php /** @var \Illuminate\Support\Collection $stabili */ /** @var \App\Models\Stabile|null $stabileAttivo */ $activeId = $stabileAttivo?->id; $stabileHasRiscaldamento = static function (?\App\Models\Stabile $stabile): bool { if (! $stabile) { return false; } return method_exists($stabile, 'hasOperationalHeating') ? $stabile->hasOperationalHeating() : false; }; $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
Selettore stabile temporaneamente disattivato.