refactor code: add kelola admin menu with owner role, add logic n route for profile and logout
This commit is contained in:
parent
9693ac5965
commit
32387c6479
|
|
@ -65,12 +65,14 @@ class="sidebar-item {{ request()->is('admin/beranda', 'admin/beranda-pemilik') ?
|
|||
<span>Paket Foto</span>
|
||||
</a>
|
||||
</li>
|
||||
@if (Auth::user()->role == 'pemilik')
|
||||
<li class="sidebar-item {{ request()->is('admin/kelola-admin*') ? 'active' : '' }}">
|
||||
<a href="{{ route('admin.kelola-admin.index') }}" class='sidebar-link'>
|
||||
<i class="bi bi-people-fill"></i>
|
||||
<span>Kelola Admin</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -94,15 +96,31 @@ class="sidebar-item {{ request()->is('admin/beranda', 'admin/beranda-pemilik') ?
|
|||
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="profileDropdown"
|
||||
style="min-width: 150px;">
|
||||
<li class="dropdown-header text-center">
|
||||
<h6 class="mb-0 text-dark">Nama Admin</h6>
|
||||
<small class="text-muted">Administrator</small>
|
||||
<h6 class="mb-0 text-dark">{{ Auth::user()->username ?? 'Admin' }}</h6>
|
||||
<small class="text-muted">{{ ucfirst(Auth::user()->role ?? 'Administrator') }}</small>
|
||||
</li>
|
||||
<li>
|
||||
<hr class="dropdown-divider mt-0">
|
||||
</li>
|
||||
<li><a class="dropdown-item" href="{{ route('admin.profil.index') }}"
|
||||
style="font-size: 0.9rem;">Profil Saya</a></li>
|
||||
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('admin.profil.index') }}"
|
||||
style="font-size: 0.9rem;">
|
||||
Profil Saya
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="dropdown-item text-danger" href="#"
|
||||
onclick="event.preventDefault(); document.getElementById('logout-form').submit();"
|
||||
style="font-size: 0.9rem;">
|
||||
Keluar
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -122,6 +140,8 @@ class="sidebar-item {{ request()->is('admin/beranda', 'admin/beranda-pemilik') ?
|
|||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
<script src="{{ asset('js/ex-simple-datatables.js') }}"></script>
|
||||
<script src="{{ asset('js/simple-datatables.js') }}"></script>
|
||||
|
||||
{{-- MODAL TOOLTIP --}}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
|
|
@ -130,7 +150,8 @@ class="sidebar-item {{ request()->is('admin/beranda', 'admin/beranda-pemilik') ?
|
|||
})
|
||||
}, false);
|
||||
</script>
|
||||
@yield('scripts')
|
||||
@stack('scripts')
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue