﻿# Fix 1: Tambah hamburger di topbar app.blade.php
file = r'resources\views\layouts\app.blade.php'
with open(file, 'r', encoding='utf-8') as f:
    c = f.read()

old_topbar = '''    <div class="topbar d-flex align-items-center justify-content-between">
          <h6 class="mb-0 fw-semibold text-dark">@yield('title', 'Dashboard')</h6>'''

new_topbar = '''    <div class="topbar d-flex align-items-center justify-content-between">
        <div class="d-flex align-items-center gap-2">
            <button class="hamburger" onclick="toggleSidebar()" aria-label="Menu">
                <i class="bi bi-list"></i>
            </button>
            <h6 class="mb-0 fw-semibold text-dark">@yield('title', 'Dashboard')</h6>
        </div>'''

if old_topbar in c:
    c = c.replace(old_topbar, new_topbar)
    print("topbar: hamburger ditambahkan")
else:
    print("topbar: pattern tidak ditemukan, cari manual...")
    idx = c.find('topbar d-flex')
    print(repr(c[idx:idx+200]))

with open(file, 'w', encoding='utf-8') as f:
    f.write(c)
