@if (Auth::check() == true)
@php
$ticket_waiting = \App\Models\Ticket::where([['user_id', Auth::user()->id], ['is_read_user', '0']])->count();
@endphp
<li class="side-nav-title side-nav-item">Menu</li>
<li class="side-nav-item @if (request()->path() == '/') mm-active @endif">
    <a href="{{ url('/') }}" class="side-nav-link @if (request()->path() == '/') active @endif">
        <i class="fa fa-home"></i>
        <span>Dasbor</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="{{ url('page/hof') }}" class="side-nav-link">
        <i class="menu-icon fa fa-trophy"></i>
        <span>Top Terbaik</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="javascript: void(0);" class="side-nav-link">
        <i class="fa fa-shopping-cart"></i>
        <span>Pemesanan</span>
        <span class="menu-arrow"></span>
    </a>
    <ul class="side-nav-second-level" aria-expanded="false">
        <li><a href="{{ url('order/new') }}">Pesan Baru</a></li>
        <li><a href="{{ url('order/history') }}">Riwayat Pesanan</a></li>
        <li><a href="{{ url('order/refill/history') }}">Riwayat Refill</a></li>
        <li><a href="{{ url('page/service/monitoring') }}">Monitoring Layanan</a></li>
    </ul>
</li>
<li class="side-nav-item">
    <a href="javascript: void(0);" class="side-nav-link">
        <i class="fa fa-money-check-alt"></i>
        <span>Deposit</span>
        <span class="menu-arrow"></span>
    </a>
    <ul class="side-nav-second-level" aria-expanded="false">
        <li><a href="{{ url('deposit/new') }}">Deposit Baru</a></li>
        <li><a href="{{ url('deposit/history') }}">Riwayat</a></li>
    </ul>
</li>
<li class="side-nav-item">
    <a href="{{ url('ticket/list') }}" class="side-nav-link">
        <i class="fa fa-envelope"></i>
        @if ($ticket_waiting > 0)
        <span class="badge badge-pill badge-warning float-right">{{ $ticket_waiting }}</span>
        @endif
        <span>Tiket</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="{{ url('page/service/list') }}" class="side-nav-link">
        <i class="menu-icon fa fa-tags"></i>
        <span>Daftar Layanan</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="javascript: void(0);" class="side-nav-link">
        <i class="fa fa-file"></i>
        <span>Halaman</span>
        <span class="menu-arrow"></span>
    </a>
    <ul class="side-nav-second-level" aria-expanded="false">
        @foreach (\App\Models\WebsitePage::all() as $item)
            <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>
<li class="side-nav-item">
    <a href="{{ url('page/api_doc') }}" class="side-nav-link">
        <i class="menu-icon fa fa-book"></i>
        <span>Dokumentasi API</span>
    </a>
</li>
@else
<li class="side-nav-item">
    <a href="{{ url('/') }}" class="side-nav-link">
        <i class="menu-icon fa fa-home"></i>
        <span>Dasbor</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="{{ url('auth/login') }}" class="side-nav-link"> 
        <i class="menu-icon fa fa-sign-in-alt"></i>
        <span>Masuk</span>
    </a>
</li>
@if (Route::has('user.register'))
<li class="side-nav-item">
    <a href="{{ url('auth/register') }}" class="side-nav-link"> 
        <i class="menu-icon fa fa-user-plus"></i>
        <span>Daftar</span>
    </a>
</li>
@endif
@if (Route::has('user.reset'))
<li class="side-nav-item">
    <a href="{{ url('auth/reset') }}" class="side-nav-link"> 
        <i class="menu-icon fa fa-key"></i>
        <span>Atur Ulang Kata Sandi</span>
    </a>
</li>
@endif
<li class="side-nav-item">
    <a href="{{ url('page/service/list') }}" class="side-nav-link">
        <i class="menu-icon fa fa-tags"></i>
        <span>Daftar Layanan</span>
    </a>
</li>
<li class="side-nav-item">
    <a href="javascript: void(0);" class="side-nav-link">
        <i class="fa fa-file"></i>
        <span>Halaman</span>
        <span class="menu-arrow"></span>
    </a>
    <ul class="side-nav-second-level" aria-expanded="false">
        @foreach (\App\Models\WebsitePage::all() as $item)
            <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>
@endif