Airport Guide Documentation

MenuController extends BaseController
in package

Menu Controller

This controller manages comprehensive menu operations including menu CRUD, hierarchical menu management, menu type filtering, and menu organization. It provides functionality for managing website navigation menus with parent-child relationships, sorting capabilities, and menu type categorization for different navigation areas.

Table of Contents

Methods

__construct()  : void
Create a new MenuController instance.
create()  : View
Show the form for creating a new menu item.
destroy()  : RedirectResponse
Remove the specified menu item from storage.
edit()  : View
Show the form for editing the specified menu item.
index()  : View
Display a listing of menus with type-based filtering and hierarchical organization.
store()  : RedirectResponse
Store a newly created menu item in storage.
update()  : RedirectResponse
Update the specified menu item in storage.

Methods

__construct()

Create a new MenuController instance.

public __construct() : void

Checks if user is logged in and has proper permissions for menu management. Redirects to appropriate page if permissions are not met.

create()

Show the form for creating a new menu item.

public create(Request $request) : View

Displays the menu creation form with parent menu dropdown options. Initializes form fields and loads reference data for menu creation. Supports different menu types and hierarchical menu structure.

Parameters
$request : Request
Return values
View

destroy()

Remove the specified menu item from storage.

public destroy(Request $request, int $id) : RedirectResponse

Deletes the menu record and logs the activity for audit purposes. Handles menu type filtering and provides appropriate feedback message. Maintains menu type context for proper redirect.

Parameters
$request : Request
$id : int
Return values
RedirectResponse

edit()

Show the form for editing the specified menu item.

public edit(int $id, Request $request) : View

Validates user permissions and menu ID before displaying the edit form. Includes security checks with MD5 hash validation for menu access. Loads existing menu data and parent menu options for editing.

Parameters
$id : int
$request : Request
Return values
View

index()

Display a listing of menus with type-based filtering and hierarchical organization.

public index(Request $request) : View

Provides a paginated list of menus filtered by menu type (top, footer, etc.). Supports search functionality and displays parent-child menu relationships. Includes sortable columns and hierarchical menu structure management.

Parameters
$request : Request
Return values
View

store()

Store a newly created menu item in storage.

public store(Request $request) : RedirectResponse

Validates menu data, creates a new menu record, and logs the activity. Handles menu type categorization and parent-child relationships. Supports menu URL, target, sorting, and status management.

Parameters
$request : Request
Return values
RedirectResponse

update()

Update the specified menu item in storage.

public update(Request $request, int $id) : RedirectResponse

Validates menu data, updates the menu record, and logs the activity. Handles menu type categorization and parent-child relationships. Supports menu URL, target, sorting, and status updates.

Parameters
$request : Request
$id : int
Return values
RedirectResponse

        
On this page

Search results