@props([ 'title' => 'Dashboard', 'adminKey' => 'overview', 'page' => null, ]) ($_COOKIE['wa_admin_sidebar'] ?? null) === 'collapsed', ])> {{-- Sub-folder base path (e.g. /public) so client-side AJAX honours the deploy location under a sub-directory. --}} {{-- Active platform currency symbol — read by chart JS so axes/tooltips follow the admin's default_currency instead of a hardcoded '$'. --}} @php $faviconUrl = \App\Support\Brand::faviconUrl(); $brandTitle = (string) \App\Models\SystemSetting::get('app_name', config('app.name', 'WaDesk')); @endphp @if ($faviconUrl) @endif {{ $title }} — {{ $brandTitle }} {{ __('Admin') }} {{-- SEO meta block — read from /admin/settings/seo. Admin pages override the title above; per-page description/og overrides are supported via $seoOverrides if a page sets it. --}} @include('partials.seo-meta', ['seoOverrides' => ['title' => $title . ' — ' . $brandTitle]]) @include('partials.pwa-meta') {{-- Visitor analytics scripts (GA, Pixel, Clarity, etc.) are NOT loaded inside admin — we don't track admins on their own management UI. They render on user + guest layouts only. --}} @php // Per-theme logo URLs uploaded by admin at /admin/settings/general. // wadesk.js setTheme() reads this map and swaps the brand src // to the right variant whenever the user picks a different theme // — no reload needed. $brandLogos = []; foreach (['paper', 'bright', 'dark', 'doodle'] as $__t) { $brandLogos[$__t] = \App\Support\Brand::logoUrl($__t); } @endphp @auth @endauth @vite(['resources/css/app.css', 'resources/js/app.js'])
{{ $slot }}
{{-- Global flash banner — every admin controller writes session('success' | 'status' | 'error') after a save; this pops a fixed toast so the admin sees confirmation regardless of which page they're on (some pages render their own banner inline, this is the fallback for pages that don't). Auto- dismisses after 4s; click X to dismiss early. --}} @php $flashMsg = session('success') ?: session('status') ?: null; $flashErr = session('error'); @endphp @if ($flashMsg || $flashErr)
@if ($flashErr) @else @endif {{ $flashErr ?: $flashMsg }}
@endif {{-- Cookie consent is intentionally NOT included in the admin layout. It's a visitor-facing GDPR/CCPA artifact for the user dashboard and public pages, not for the admins managing the platform. --}} @stack('scripts') {{-- Header-right control set rendered ONCE inline (not inside a template) so wadesk.js can find #wa-theme-btn etc on its DOMContentLoaded pass. The script below MOVES the element into the page's [data-admin-header-right] slot before paint so the user never sees it at the bottom. --}} @auth @endauth