JezK
Edit File: app.blade.php
<!DOCTYPE html> <html lang="id" class="h-full"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>{{ $title ?? 'Dashboard' }} — NusaDaya CMS</title> <link rel="icon" href="https://res.cloudinary.com/dmdl9p7do/image/upload/v1776403982/Logo_Nusadaya_Academy_-_Navbar_ppmaep.png" type="image/png"> @vite(['resources/css/app.css', 'resources/js/app.js']) </head> <body class="h-full bg-surface font-sans text-gray-900 antialiased"> <div class="flex h-full"> {{-- Sidebar --}} @include('components.sidebar') {{-- Main Content --}} <div class="flex-1 flex flex-col min-h-screen lg:ml-[272px] min-w-0"> {{-- Top Navbar --}} @include('components.navbar') {{-- Page Content --}} <main class="flex-1 p-4 sm:p-6 lg:p-8 w-full max-w-full overflow-x-hidden"> @if(session('success')) <div class="toast"> <div class="flex items-center gap-3 bg-emerald-50 border border-emerald-200 text-emerald-800 px-5 py-3.5 rounded-xl shadow-lg"> <svg class="w-5 h-5 text-emerald-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg> <span class="text-sm font-medium">{{ session('success') }}</span> </div> </div> @endif @if(session('error')) <div class="toast"> <div class="flex items-center gap-3 bg-red-50 border border-red-200 text-red-800 px-5 py-3.5 rounded-xl shadow-lg"> <svg class="w-5 h-5 text-red-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg> <span class="text-sm font-medium">{{ session('error') }}</span> </div> </div> @endif {{ $slot ?? '' }} @yield('content') </main> </div> </div> {{-- Mobile sidebar overlay --}} <div id="sidebar-overlay" class="fixed inset-0 bg-black/50 z-40 hidden lg:hidden" onclick="toggleSidebar()"></div> <script> function toggleSidebar() { const sidebar = document.getElementById('sidebar'); const overlay = document.getElementById('sidebar-overlay'); sidebar.classList.toggle('-translate-x-full'); overlay.classList.toggle('hidden'); } // Sidebar Dropdown document.querySelectorAll('.sidebar-dropdown-toggle').forEach(toggle => { toggle.addEventListener('click', (e) => { e.preventDefault(); const targetId = toggle.getAttribute('data-target'); const menu = document.getElementById(targetId); const icon = toggle.querySelector('.chevron-icon'); menu.classList.toggle('hidden'); icon.classList.toggle('rotate-180'); }); }); // Auto-hide toast after 4 seconds setTimeout(() => { document.querySelectorAll('.toast').forEach(t => t.remove()); }, 4000); </script> @stack('scripts') </body> </html>