{"action":"created","issue":{"url":"https://api.github.com/repos/nWidart/laravel-menus/issues/1","repository_url":"https://api.github.com/repos/nWidart/laravel-menus","labels_url":"https://api.github.com/repos/nWidart/laravel-menus/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nWidart/laravel-menus/issues/1/comments","events_url":"https://api.github.com/repos/nWidart/laravel-menus/issues/1/events","html_url":"https://github.com/nWidart/laravel-menus/issues/1","id":177242875,"number":1,"title":"Display menu options based on role","user":{"login":"boofman15","id":21362089,"avatar_url":"https://avatars.githubusercontent.com/u/21362089?v=3","gravatar_id":"","url":"https://api.github.com/users/boofman15","html_url":"https://github.com/boofman15","followers_url":"https://api.github.com/users/boofman15/followers","following_url":"https://api.github.com/users/boofman15/following{/other_user}","gists_url":"https://api.github.com/users/boofman15/gists{/gist_id}","starred_url":"https://api.github.com/users/boofman15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boofman15/subscriptions","organizations_url":"https://api.github.com/users/boofman15/orgs","repos_url":"https://api.github.com/users/boofman15/repos","events_url":"https://api.github.com/users/boofman15/events{/privacy}","received_events_url":"https://api.github.com/users/boofman15/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-15T17:53:05Z","updated_at":"2016-12-30T17:36:05Z","closed_at":null,"body":"Does your menu support attaching a policy to a menu item so that item only displays for users with that permission policy?\n"},"comment":{"url":"https://api.github.com/repos/nWidart/laravel-menus/issues/comments/269799309","html_url":"https://github.com/nWidart/laravel-menus/issues/1#issuecomment-269799309","issue_url":"https://api.github.com/repos/nWidart/laravel-menus/issues/1","id":269799309,"user":{"login":"noxify","id":521777,"avatar_url":"https://avatars.githubusercontent.com/u/521777?v=3","gravatar_id":"","url":"https://api.github.com/users/noxify","html_url":"https://github.com/noxify","followers_url":"https://api.github.com/users/noxify/followers","following_url":"https://api.github.com/users/noxify/following{/other_user}","gists_url":"https://api.github.com/users/noxify/gists{/gist_id}","starred_url":"https://api.github.com/users/noxify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noxify/subscriptions","organizations_url":"https://api.github.com/users/noxify/orgs","repos_url":"https://api.github.com/users/noxify/repos","events_url":"https://api.github.com/users/noxify/events{/privacy}","received_events_url":"https://api.github.com/users/noxify/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T17:36:05Z","updated_at":"2016-12-30T17:36:05Z","body":"Hi,\r\n\r\nmaybe a bit late, but I had the same problem.\r\n\r\nThe solution is the `hideWhen()` method.\r\n\r\nHere a short example:\r\n\r\n```\r\n\t$menu->route('rinvex.fort.frontend.login', 'Sign in')->hideWhen(function() {return \\Auth::check();});\r\n\t$menu->route('rinvex.fort.frontend.register', 'Sign up')->hideWhen(function() {return \\Auth::check();});\r\n\t$menu->dropdown('My Account', function ($sub) {\r\n\t\t$sub->route('rinvex.fort.frontend.user.settings', 'Settings');\r\n\t\t$sub->route('rinvex.fort.frontend.user.settings.account', 'Account');\r\n\t\t$sub->route('rinvex.fort.frontend.user.settings.password', 'Password');\r\n\t\t$sub->route('rinvex.fort.frontend.user.twofactor.totp.enable', 'Security');\r\n\t\t$sub->route('rinvex.fort.frontend.user.sessions', 'Sessions');\r\n\t})->hideWhen(function() {return !\\Auth::check();});\r\n```\r\n\r\n"}}
{"actor":{"display_login":"noxify"}}