{"action":"created","issue":{"url":"https://api.github.com/repos/spatie/laravel-menu/issues/2","repository_url":"https://api.github.com/repos/spatie/laravel-menu","labels_url":"https://api.github.com/repos/spatie/laravel-menu/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/spatie/laravel-menu/issues/2/comments","events_url":"https://api.github.com/repos/spatie/laravel-menu/issues/2/events","html_url":"https://github.com/spatie/laravel-menu/issues/2","id":143494111,"number":2,"title":"[Suggestion] Fluent API for considering authorization","user":{"login":"sebastiandedeyne","id":1561079,"avatar_url":"https://avatars.githubusercontent.com/u/1561079?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastiandedeyne","html_url":"https://github.com/sebastiandedeyne","followers_url":"https://api.github.com/users/sebastiandedeyne/followers","following_url":"https://api.github.com/users/sebastiandedeyne/following{/other_user}","gists_url":"https://api.github.com/users/sebastiandedeyne/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastiandedeyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastiandedeyne/subscriptions","organizations_url":"https://api.github.com/users/sebastiandedeyne/orgs","repos_url":"https://api.github.com/users/sebastiandedeyne/repos","events_url":"https://api.github.com/users/sebastiandedeyne/events{/privacy}","received_events_url":"https://api.github.com/users/sebastiandedeyne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-25T13:00:52Z","updated_at":"2016-03-25T13:20:03Z","closed_at":null,"body":"Originally posted by @themsaid here: https://github.com/spatie/menu/issues/1\r\n\r\n```php\r\nMenu::new()\r\n    ->link('/', 'Home')\r\n    ->linkIfCan('/products', 'Products', 'review_products');\r\n    ->linkIfCan('/inventory', 'Inventory', ['check_inventory', 'update_inventory']);\r\n```"},"comment":{"url":"https://api.github.com/repos/spatie/laravel-menu/issues/comments/201273734","html_url":"https://github.com/spatie/laravel-menu/issues/2#issuecomment-201273734","issue_url":"https://api.github.com/repos/spatie/laravel-menu/issues/2","id":201273734,"user":{"login":"themsaid","id":4332182,"avatar_url":"https://avatars.githubusercontent.com/u/4332182?v=3","gravatar_id":"","url":"https://api.github.com/users/themsaid","html_url":"https://github.com/themsaid","followers_url":"https://api.github.com/users/themsaid/followers","following_url":"https://api.github.com/users/themsaid/following{/other_user}","gists_url":"https://api.github.com/users/themsaid/gists{/gist_id}","starred_url":"https://api.github.com/users/themsaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themsaid/subscriptions","organizations_url":"https://api.github.com/users/themsaid/orgs","repos_url":"https://api.github.com/users/themsaid/repos","events_url":"https://api.github.com/users/themsaid/events{/privacy}","received_events_url":"https://api.github.com/users/themsaid/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T13:20:03Z","updated_at":"2016-03-25T13:20:03Z","body":"Well my parameter ordering was based on plain english `Add (this Link) if can (this permission).`\r\n\r\nI've been developing iOS apps in swift for a little while, what I miss from swift in PHP is the ability to name parameters.\r\n\r\n```\r\nfunc add(link: Link, ifUserCan ability: String) {}\r\n```\r\n\r\nYou call it like that:\r\n\r\n```\r\nadd(Link::mylink() ifUserCan: 'manage_orders')\r\n```"}}