@if (Auth::check() == true)
@php
$ticket_waiting = \App\Models\Ticket::where([['user_id', Auth::user()->id], ['is_read_user', '0']])->count();
@endphp
<li class="menu-title">Menu</li>
<li class="@if (request()->path() == '/') mm-active @endif">
    <a href="{{ url('/') }}" class="waves-effect @if (request()->path() == '/') active @endif">
        <i class='fa fa-home fa-fw'></i>
        <span>Dasbor</span>
    </a>
</li>
<li class="has-submenu">
    <a href="{{ url('page/hof') }}">
        <i class="menu-icon fa fa-trophy"></i>
        <span>Top Terbaik</span>
    </a>
</li>
<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect"><i class="fa fa-shopping-cart fa-fw"></i> <span>Pemesanan</span></a>
    <ul class="sub-menu" aria-expanded="true">
        <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>
    <a href="javascript: void(0);" class="has-arrow waves-effect"><i class="fa fa-money-check-alt fa-fw"></i> <span>Deposit</span></a>
    <ul class="sub-menu" aria-expanded="true">
        <li><a href="{{ url('deposit/new') }}">Deposit Baru</a></li>
        <li><a href="{{ url('deposit/history') }}">Riwayat</a></li>
    </ul>
</li>
<li>
    <a href="{{ url('ticket/list') }}" class="waves-effect">
        <i class='fa fa-envelope fa-fw'></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="has-submenu">
    <a href="{{ url('page/service/list') }}">
        <i class="menu-icon fa fa-tags fa-fw"></i>
        <span>Daftar Layanan</span>
    </a>
</li>
<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect"><i class="fa fa-file fa-fw"></i> <span>Halaman</span></a>
    <ul class="sub-menu" aria-expanded="true">
        @foreach (\App\Models\WebsitePage::all() as $item)
            <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>
<li class="has-submenu">
    <a href="{{ url('page/api_doc') }}">
        <i class="menu-icon fa fa-book fa-fw"></i>
        <span>Dokumentasi API</span>
    </a>
</li>
@if (Auth::user()->level == 'Developer' OR Auth::user()->level == 'Admin')
<li class="has-submenu">
    <a href="{{ url('/admin') }}">
        <i class="menu-icon fa fa-user fa-fw"></i>
        <span>Admin Menu</span>
    </a>
</li>
@endif
@else
<li class="has-submenu">
    <a href="{{ url('/') }}">
        <i class="menu-icon fa fa-home fa-fw"></i>
        <span>Dasbor</span>
    </a>
</li>
<li class="has-submenu">
    <a href="{{ url('auth/login') }}"> 
        <i class="menu-icon fa fa-sign-in-alt fa-fw"></i>
        <span>Masuk</span>
    </a>
</li>
@if (Route::has('user.register'))
<li class="has-submenu">
    <a href="{{ url('auth/register') }}"> 
        <i class="menu-icon fa fa-user-plus fa-fw"></i>
        <span>Daftar</span>
    </a>
</li>
@endif
@if (Route::has('user.reset'))
<li class="has-submenu">
    <a href="{{ url('auth/reset') }}"> 
        <i class="menu-icon fa fa-key fa-fw"></i>
        <span>Atur Ulang Kata Sandi</span>
    </a>
</li>
@endif
<li class="has-submenu">
    <a href="{{ url('page/service/list') }}">
        <i class="menu-icon fa fa-tags fa-fw"></i>
        <span>Daftar Layanan</span>
    </a>
</li>
<li>
    <a href="javascript: void(0);" class="has-arrow waves-effect"><i class="fa fa-file fa-fw"></i> <span>Halaman</span></a>
    <ul class="sub-menu" aria-expanded="true">
        @foreach (\App\Models\WebsitePage::all() as $item)
            <li><a href="{{ url('page/site/'.$item->slug.'') }}">{{ $item->title }}</a></li>
        @endforeach
    </ul>
</li>
@endif