thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.77k stars 2.67k forks source link

Update documentation for "Creating permissions for custom page" #5685

Open haexperts2020 opened 1 year ago

haexperts2020 commented 1 year ago

Laravel version

9.0

PHP version

8.0.20

Voyager version

1.6

Database

MySQL 8.0.20

Description

The documentation only talks about slugs directly after /admin/, I am proposing that is also says multi-word slugs.

Current This only works if your slug comes directly after /admin/. So for a custom page of the form /admin/sub/foo the menu item will not be hidden from the menu.

Proposed This only works if your slug comes directly after /admin/. So for a custom page of the form /admin/sub/foo the menu item will not be hidden from the menu. In addition, the slug can only be a single word, for example /admin/slugname will work but /admin/slug-name will not.

Steps to reproduce

I had a slug called google-maps that pointed to /admin/google-maps and the menu item still appeared when the user didn't not have browse permissions.

If I change it to: google points to /admin/google it disappeared.

Expected behavior

A correct slug name will make the menu item disappear if the user doesn't into have permission to view it

Screenshots

No response

Additional context

No response