@php
$maintenanceWindows = collect();
if (auth()->check()) {
$portalCustomer = \App\Models\Customer::query()->where('user_id', auth()->id())->first()
?? \App\Models\Customer::query()->where('email', auth()->user()->email)->first();
if ($portalCustomer) {
$maintenanceWindows = \App\Models\MaintenanceWindow::bannerFor($portalCustomer);
}
}
@endphp
@if (auth()->check() && ! ($portalCustomer ?? null))
{{-- No customer behind this login (e.g. an operator account): say so, or
every customer action on these pages looks like a dead button. --}}
{{-- Sidebar: fixed drawer on small screens, fixed full-height column on large (R7). --}}
{{-- Mobile backdrop --}}
{{-- Impersonation is a MODE, not a notice: it stays visible rather
than hiding in a dropdown, because acting as someone else
without noticing is how mistakes happen. --}}
@if (session('impersonator_id'))