The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

Laravel app global/menu.php


Hello, I'm using your Laravel app theme, and I've been struggling to activate the role and permission sections in the global/menu.php file. I can't seem to assign middleware to routes through the menu. Does the theme support this feature?

<?php

return array(
// Documentation menu
'documentation' => array(
// Getting Started
array(
'heading' => 'Getting Started',
),

// Overview
array(
'title' => 'Overview',
'path' => 'documentation/getting-started/overview',
// 'role' => ['admin'], <---this part
// 'permission' => [], <---this part
),


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

 
Deleted comment

Hi Ibrahim,

To activate the role and permission sections in the global/menu.php file of the Laravel app theme, you need to implement the user's role using the Laravel Permission package. You can refer to the documentation at for detailed instructions on how to define user roles.

The theme already includes integration for the menu part, which hides certain menu items based on the user's role. The menu function responsible for this is defined in the app/Core/Adapters/Menu.php file, specifically the filterMenuPermissions method.

By defining the user's role and assigning appropriate permissions, you'll be able to control access to specific menu items based on the user's role. Please refer to the Laravel Permission documentation for more information on how to define roles and manage permissions.

If you encounter any further issues or need additional assistance, feel free to ask for help.

Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.