nasirkhan/laravel-starter
Laravel 13 modular starter with separated frontend/backend. Includes auth & authorization, user/role management, admin backend, backups, log viewer, and custom artisan commands (install, update, module builder). Use as a base to build reusable modules.
This document explains how menu and menu items are managed in the Laravel Starter application.
The application uses a hierarchical menu system where:
Admin Dashboard
└── Menus (Index)
├── View Menu (Show)
│ ├── Menu Details
│ └── Menu Items List (nested display)
│ ├── Add Menu Item
│ ├── Edit Menu Item
│ ├── Delete Menu Item
│ └── View Menu Item
└── Create/Edit Menu
Menu items are managed through their parent menu, not as a standalone resource. This provides:
GET /admin/menus - List all menus
POST /admin/menus - Create new menu
GET /admin/menus/create - Show create form
GET /admin/menus/{id} - Show menu details with items
GET /admin/menus/{id}/edit - Edit menu
PUT /admin/menus/{id} - Update menu
DELETE /admin/menus/{id} - Delete menu
POST /admin/menuitems - Create new menu item
GET /admin/menuitems/create?menu_id=X - Show create form
GET /admin/menuitems/{id} - Show menu item details
GET /admin/menuitems/{id}/edit - Edit menu item
PUT /admin/menuitems/{id} - Update menu item
DELETE /admin/menuitems/{id} - Delete menu item
Note: There is no /admin/menuitems index route. Menu items are viewed through the menu show page.
MenuItemsController changes:
index() and index_data() methodsstore() to redirect to parent menu show pageupdate() to redirect to parent menu show pagecreate(), show(), edit(), destroy() methodsweb.php changes:
// Menu Items routes - index excluded
Route::resource("menuitems", "$controller_name")->except(['index']);
menu_data.json changes:
Breadcrumbs updated:
Menus → Menu Details → Create Menu ItemMenus → Menu Details → Edit Menu ItemMenu Items → Create/Edit (incorrect context)Menu items are displayed hierarchically with:
Menu items are always viewed in the context of their parent menu, making it clear which menu they belong to.
Users don't need to navigate to a separate page to see menu items. Everything is in one place.
The nested display with indentation makes parent-child relationships immediately clear.
Fewer top-level navigation items mean less cognitive load for administrators.
The flow is intuitive:
If you're upgrading from a version with standalone menu items:
/admin/menuitems URLs to /admin/menusview_menus permission covers both menus and menu itemsIf you need programmatic access to all menu items:
use Modules\Menu\Models\MenuItem;
// Get all menu items
$allMenuItems = MenuItem::all();
// Get menu items for a specific menu
$menuItems = MenuItem::where('menu_id', $menuId)->get();
// Get hierarchical structure
$menu = Menu::with('items.children')->find($menuId);
Potential improvements to consider:
For questions or issues with menu management:
How can I help you explore Laravel packages today?