@extends('layouts.app') @section('title', 'Menu Management') @section('page-title', 'Menu Management') @section('content')
Menu Management
@php $currentUser = auth()->user(); $isSuperUser = \App\Helpers\PermissionHelper::isSuperUser($currentUser->id); // Check if user is admin or has admin role $isAdmin = false; if (in_array(strtolower($currentUser->role), ['admin', 'administrator'])) { $isAdmin = true; } // Check if user is subordinate of admin (has parent_id) $isSubordinate = !is_null($currentUser->parent_id); // Show controls only for super users $showControls = $isSuperUser; @endphp @if($showControls) Add New Menu @endif
@if(session('success')) @endif
@if($showControls) @endif @forelse($menus as $menu) @if($showControls) @endif @if($menu->children->count() > 0) @foreach($menu->children as $child) @if($showControls) @endif @endforeach @endif @empty @endforelse
Menu Name Icon Section Route/URL Parent Order StatusActions
@if($menu->icon) @endif
{{ $menu->name }} @if($menu->is_dropdown)
Dropdown Menu @endif
@if($menu->icon) @else - @endif @if($menu->section) {{ $menu->section }} @else - @endif @if($menu->route) {{ $menu->route }} @elseif($menu->url) {{ $menu->url }} @else - @endif Main Menu {{ $menu->sort_order }} @if($menu->is_active) Active @else Inactive @endif
@csrf @method('DELETE')
@if($child->icon) @endif {{ $child->name }}
@if($child->icon) @else - @endif @if($child->section) {{ $child->section }} @else - @endif @if($child->route) {{ $child->route }} @elseif($child->url) {{ $child->url }} @else - @endif {{ $child->parent->name }} {{ $child->sort_order }} @if($child->is_active) Active @else Inactive @endif
@csrf @method('DELETE')
No Menus Found
@if($showControls)

Start by creating your first menu item.

Create First Menu @else

No menu items available.

@endif
@push('styles') @endpush @push('scripts') @endpush @endsection