@php
$user = auth()->user();
$srcLight = null;
$srcDark = null;
$alt = config('app.name', 'Auto1Cloud2.0');
if ($user) {
try {
$locationId = \App\Support\UserScope::getCurrentLocationId($user);
if ($locationId) {
$location = \App\Models\Location::query()->with('brand')->find($locationId);
if ($location && $location->brand) {
$srcLight = $location->brand->logo ?: null;
$srcDark = $location->brand->logo_inverted ?: null;
$alt = $location->brand->name ?: $alt;
}
}
} catch (\Throwable $e) {
// Silently fail to text logo if anything goes wrong
}
}
@endphp
@if ($srcLight || $srcDark)
@if ($srcLight)
@endif
@if ($srcDark)
@endif
@else
{{ $alt }}
@endif