{"action":"opened","number":64,"pull_request":{"url":"https://api.github.com/repos/spatie/menu/pulls/64","id":169653426,"html_url":"https://github.com/spatie/menu/pull/64","diff_url":"https://github.com/spatie/menu/pull/64.diff","patch_url":"https://github.com/spatie/menu/pull/64.patch","issue_url":"https://api.github.com/repos/spatie/menu/issues/64","number":64,"state":"open","locked":false,"title":"Add support for Bootstrap 4","user":{"login":"mrk-j","id":1250622,"avatar_url":"https://avatars0.githubusercontent.com/u/1250622?v=4","gravatar_id":"","url":"https://api.github.com/users/mrk-j","html_url":"https://github.com/mrk-j","followers_url":"https://api.github.com/users/mrk-j/followers","following_url":"https://api.github.com/users/mrk-j/following{/other_user}","gists_url":"https://api.github.com/users/mrk-j/gists{/gist_id}","starred_url":"https://api.github.com/users/mrk-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrk-j/subscriptions","organizations_url":"https://api.github.com/users/mrk-j/orgs","repos_url":"https://api.github.com/users/mrk-j/repos","events_url":"https://api.github.com/users/mrk-j/events{/privacy}","received_events_url":"https://api.github.com/users/mrk-j/received_events","type":"User","site_admin":false},"body":"When merged this PR adds support for Bootstrap 4. \r\n\r\nWe added 3 new methods for the `Menu` class:\r\n\r\n- `setTagName` enables using another element as an `<ul>`\r\n- `setWrapLinksInList` can disable automatic the wrapping of links in `<li>`'s\r\n- `setActiveClassOnLink` can set the `activeClass` on the link instead of the `<li>`\r\n\r\nTo set the active class on the link we assume that the item supplied to `renderItem` implements `HasHtmlAttributes`. I think it is pretty safe to do so, but to be safe we added a check to see if the item implements `HasHtmlAttributes`.\r\n\r\nThe syntax to render a Bootstrap 4 menu looks like this:\r\n\r\n``` php\r\n$submenu = Menu::new()\r\n    ->setTagName('div')\r\n    ->addClass('dropdown-menu')\r\n    ->setWrapLinksInList(false)\r\n    ->setActiveClassOnLink(true)\r\n    ->add(Link::to('/about', 'About')->addParentClass('nav-item')->addClass('dropdown-item'));\r\n\r\nMenu::new()\r\n    ->addClass('navbar-nav')\r\n    ->add(Link::to('/', 'Home')->addParentClass('nav-item')->addClass('nav-link'))\r\n    ->submenu(Link::to('#', 'Dropdown link')->addClass('nav-link dropdown-toggle')->setAttribute('data-toggle', 'dropdown'), $submenu->addParentClass('nav-item dropdown'))\r\n    ->setActive(function (Link $link) {\r\n        return $link->url() === '/about';\r\n    })->render();\r\n```","created_at":"2018-02-16T15:33:22Z","updated_at":"2018-02-16T15:33:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spatie/menu/pulls/64/commits","review_comments_url":"https://api.github.com/repos/spatie/menu/pulls/64/comments","review_comment_url":"https://api.github.com/repos/spatie/menu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spatie/menu/issues/64/comments","statuses_url":"https://api.github.com/repos/spatie/menu/statuses/c616c3b059ba47623037f239af532627cc656428","head":{"label":"digifactory:bootstrap-4","ref":"bootstrap-4","sha":"c616c3b059ba47623037f239af532627cc656428","user":{"login":"digifactory","id":28384191,"avatar_url":"https://avatars3.githubusercontent.com/u/28384191?v=4","gravatar_id":"","url":"https://api.github.com/users/digifactory","html_url":"https://github.com/digifactory","followers_url":"https://api.github.com/users/digifactory/followers","following_url":"https://api.github.com/users/digifactory/following{/other_user}","gists_url":"https://api.github.com/users/digifactory/gists{/gist_id}","starred_url":"https://api.github.com/users/digifactory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digifactory/subscriptions","organizations_url":"https://api.github.com/users/digifactory/orgs","repos_url":"https://api.github.com/users/digifactory/repos","events_url":"https://api.github.com/users/digifactory/events{/privacy}","received_events_url":"https://api.github.com/users/digifactory/received_events","type":"Organization","site_admin":false},"repo":{"id":120320354,"name":"menu","full_name":"digifactory/menu","owner":{"login":"digifactory","id":28384191,"avatar_url":"https://avatars3.githubusercontent.com/u/28384191?v=4","gravatar_id":"","url":"https://api.github.com/users/digifactory","html_url":"https://github.com/digifactory","followers_url":"https://api.github.com/users/digifactory/followers","following_url":"https://api.github.com/users/digifactory/following{/other_user}","gists_url":"https://api.github.com/users/digifactory/gists{/gist_id}","starred_url":"https://api.github.com/users/digifactory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digifactory/subscriptions","organizations_url":"https://api.github.com/users/digifactory/orgs","repos_url":"https://api.github.com/users/digifactory/repos","events_url":"https://api.github.com/users/digifactory/events{/privacy}","received_events_url":"https://api.github.com/users/digifactory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digifactory/menu","description":"Html menu generator","fork":true,"url":"https://api.github.com/repos/digifactory/menu","forks_url":"https://api.github.com/repos/digifactory/menu/forks","keys_url":"https://api.github.com/repos/digifactory/menu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digifactory/menu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digifactory/menu/teams","hooks_url":"https://api.github.com/repos/digifactory/menu/hooks","issue_events_url":"https://api.github.com/repos/digifactory/menu/issues/events{/number}","events_url":"https://api.github.com/repos/digifactory/menu/events","assignees_url":"https://api.github.com/repos/digifactory/menu/assignees{/user}","branches_url":"https://api.github.com/repos/digifactory/menu/branches{/branch}","tags_url":"https://api.github.com/repos/digifactory/menu/tags","blobs_url":"https://api.github.com/repos/digifactory/menu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digifactory/menu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digifactory/menu/git/refs{/sha}","trees_url":"https://api.github.com/repos/digifactory/menu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digifactory/menu/statuses/{sha}","languages_url":"https://api.github.com/repos/digifactory/menu/languages","stargazers_url":"https://api.github.com/repos/digifactory/menu/stargazers","contributors_url":"https://api.github.com/repos/digifactory/menu/contributors","subscribers_url":"https://api.github.com/repos/digifactory/menu/subscribers","subscription_url":"https://api.github.com/repos/digifactory/menu/subscription","commits_url":"https://api.github.com/repos/digifactory/menu/commits{/sha}","git_commits_url":"https://api.github.com/repos/digifactory/menu/git/commits{/sha}","comments_url":"https://api.github.com/repos/digifactory/menu/comments{/number}","issue_comment_url":"https://api.github.com/repos/digifactory/menu/issues/comments{/number}","contents_url":"https://api.github.com/repos/digifactory/menu/contents/{+path}","compare_url":"https://api.github.com/repos/digifactory/menu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digifactory/menu/merges","archive_url":"https://api.github.com/repos/digifactory/menu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digifactory/menu/downloads","issues_url":"https://api.github.com/repos/digifactory/menu/issues{/number}","pulls_url":"https://api.github.com/repos/digifactory/menu/pulls{/number}","milestones_url":"https://api.github.com/repos/digifactory/menu/milestones{/number}","notifications_url":"https://api.github.com/repos/digifactory/menu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digifactory/menu/labels{/name}","releases_url":"https://api.github.com/repos/digifactory/menu/releases{/id}","deployments_url":"https://api.github.com/repos/digifactory/menu/deployments","created_at":"2018-02-05T15:06:13Z","updated_at":"2018-02-05T15:06:15Z","pushed_at":"2018-02-16T15:30:27Z","git_url":"git://github.com/digifactory/menu.git","ssh_url":"git@github.com:digifactory/menu.git","clone_url":"https://github.com/digifactory/menu.git","svn_url":"https://github.com/digifactory/menu","homepage":"https://murze.be/2016/03/a-modern-package-to-generate-menus/","size":196,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spatie:master","ref":"master","sha":"719bf45feb22fa898cb209805d271a133ef855f3","user":{"login":"spatie","id":7535935,"avatar_url":"https://avatars0.githubusercontent.com/u/7535935?v=4","gravatar_id":"","url":"https://api.github.com/users/spatie","html_url":"https://github.com/spatie","followers_url":"https://api.github.com/users/spatie/followers","following_url":"https://api.github.com/users/spatie/following{/other_user}","gists_url":"https://api.github.com/users/spatie/gists{/gist_id}","starred_url":"https://api.github.com/users/spatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatie/subscriptions","organizations_url":"https://api.github.com/users/spatie/orgs","repos_url":"https://api.github.com/users/spatie/repos","events_url":"https://api.github.com/users/spatie/events{/privacy}","received_events_url":"https://api.github.com/users/spatie/received_events","type":"Organization","site_admin":false},"repo":{"id":51363080,"name":"menu","full_name":"spatie/menu","owner":{"login":"spatie","id":7535935,"avatar_url":"https://avatars0.githubusercontent.com/u/7535935?v=4","gravatar_id":"","url":"https://api.github.com/users/spatie","html_url":"https://github.com/spatie","followers_url":"https://api.github.com/users/spatie/followers","following_url":"https://api.github.com/users/spatie/following{/other_user}","gists_url":"https://api.github.com/users/spatie/gists{/gist_id}","starred_url":"https://api.github.com/users/spatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatie/subscriptions","organizations_url":"https://api.github.com/users/spatie/orgs","repos_url":"https://api.github.com/users/spatie/repos","events_url":"https://api.github.com/users/spatie/events{/privacy}","received_events_url":"https://api.github.com/users/spatie/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spatie/menu","description":"Html menu generator","fork":false,"url":"https://api.github.com/repos/spatie/menu","forks_url":"https://api.github.com/repos/spatie/menu/forks","keys_url":"https://api.github.com/repos/spatie/menu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spatie/menu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spatie/menu/teams","hooks_url":"https://api.github.com/repos/spatie/menu/hooks","issue_events_url":"https://api.github.com/repos/spatie/menu/issues/events{/number}","events_url":"https://api.github.com/repos/spatie/menu/events","assignees_url":"https://api.github.com/repos/spatie/menu/assignees{/user}","branches_url":"https://api.github.com/repos/spatie/menu/branches{/branch}","tags_url":"https://api.github.com/repos/spatie/menu/tags","blobs_url":"https://api.github.com/repos/spatie/menu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spatie/menu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spatie/menu/git/refs{/sha}","trees_url":"https://api.github.com/repos/spatie/menu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spatie/menu/statuses/{sha}","languages_url":"https://api.github.com/repos/spatie/menu/languages","stargazers_url":"https://api.github.com/repos/spatie/menu/stargazers","contributors_url":"https://api.github.com/repos/spatie/menu/contributors","subscribers_url":"https://api.github.com/repos/spatie/menu/subscribers","subscription_url":"https://api.github.com/repos/spatie/menu/subscription","commits_url":"https://api.github.com/repos/spatie/menu/commits{/sha}","git_commits_url":"https://api.github.com/repos/spatie/menu/git/commits{/sha}","comments_url":"https://api.github.com/repos/spatie/menu/comments{/number}","issue_comment_url":"https://api.github.com/repos/spatie/menu/issues/comments{/number}","contents_url":"https://api.github.com/repos/spatie/menu/contents/{+path}","compare_url":"https://api.github.com/repos/spatie/menu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spatie/menu/merges","archive_url":"https://api.github.com/repos/spatie/menu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spatie/menu/downloads","issues_url":"https://api.github.com/repos/spatie/menu/issues{/number}","pulls_url":"https://api.github.com/repos/spatie/menu/pulls{/number}","milestones_url":"https://api.github.com/repos/spatie/menu/milestones{/number}","notifications_url":"https://api.github.com/repos/spatie/menu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spatie/menu/labels{/name}","releases_url":"https://api.github.com/repos/spatie/menu/releases{/id}","deployments_url":"https://api.github.com/repos/spatie/menu/deployments","created_at":"2016-02-09T11:34:31Z","updated_at":"2018-02-12T16:10:57Z","pushed_at":"2017-11-13T09:10:21Z","git_url":"git://github.com/spatie/menu.git","ssh_url":"git@github.com:spatie/menu.git","clone_url":"https://github.com/spatie/menu.git","svn_url":"https://github.com/spatie/menu","homepage":"https://murze.be/2016/03/a-modern-package-to-generate-menus/","size":190,"stargazers_count":311,"watchers_count":311,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":40,"open_issues":4,"watchers":311,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spatie/menu/pulls/64"},"html":{"href":"https://github.com/spatie/menu/pull/64"},"issue":{"href":"https://api.github.com/repos/spatie/menu/issues/64"},"comments":{"href":"https://api.github.com/repos/spatie/menu/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/spatie/menu/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/spatie/menu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spatie/menu/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/spatie/menu/statuses/c616c3b059ba47623037f239af532627cc656428"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":251,"deletions":1,"changed_files":3}}
{"actor":{"display_login":"mrk-j"}}