{"action":"created","comment":{"url":"https://api.github.com/repos/laravel/laravel.com/pulls/comments/31932400","id":31932400,"diff_hunk":"@@ -0,0 +1,18 @@\n+<?php namespace App\\Commands\\Docs;\n+\n+use App\\Commands\\Command;\n+use App\\Services\\Documentation\\Indexer;\n+use Illuminate\\Contracts\\Bus\\SelfHandling;\n+\n+class IndexAllDocuments extends Command implements SelfHandling {\n+\n+\t/**\n+\t * Index all of our local documentation in ElasticSearch\n+\t *\n+\t * @param Indexer $indexer\n+\t */\n+\tpublic function handle(Indexer $indexer)\n+\t{\n+\t\t$indexer->indexAllDocuments();\n+\t}\n+}","path":"app/Commands/Docs/IndexAllDocuments.php","position":18,"original_position":18,"commit_id":"b9ff772fc995c975497d46ef7f202b391167416e","original_commit_id":"b9ff772fc995c975497d46ef7f202b391167416e","user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"body":"cs","created_at":"2015-06-08T16:25:45Z","updated_at":"2015-06-08T16:25:45Z","html_url":"https://github.com/laravel/laravel.com/pull/37#discussion_r31932400","pull_request_url":"https://api.github.com/repos/laravel/laravel.com/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/comments/31932400"},"html":{"href":"https://github.com/laravel/laravel.com/pull/37#discussion_r31932400"},"pull_request":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/laravel/laravel.com/pulls/37","id":36299867,"html_url":"https://github.com/laravel/laravel.com/pull/37","diff_url":"https://github.com/laravel/laravel.com/pull/37.diff","patch_url":"https://github.com/laravel/laravel.com/pull/37.patch","issue_url":"https://api.github.com/repos/laravel/laravel.com/issues/37","number":37,"state":"open","locked":false,"title":"Add documentation search","user":{"login":"maxiloc","id":1689007,"avatar_url":"https://avatars.githubusercontent.com/u/1689007?v=3","gravatar_id":"","url":"https://api.github.com/users/maxiloc","html_url":"https://github.com/maxiloc","followers_url":"https://api.github.com/users/maxiloc/followers","following_url":"https://api.github.com/users/maxiloc/following{/other_user}","gists_url":"https://api.github.com/users/maxiloc/gists{/gist_id}","starred_url":"https://api.github.com/users/maxiloc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxiloc/subscriptions","organizations_url":"https://api.github.com/users/maxiloc/orgs","repos_url":"https://api.github.com/users/maxiloc/repos","events_url":"https://api.github.com/users/maxiloc/events{/privacy}","received_events_url":"https://api.github.com/users/maxiloc/received_events","type":"User","site_admin":false},"body":"# Context\r\n\r\nI always wanted to have search capabilities inside the Laravel documentation so I made it.\r\n\r\n![PR Demo](http://s4.postimg.org/68xtun3ot/laravel_doc_algolia.gif)\r\n\r\nYou can test the live demo here [http://laravel.neptos.fr/docs/5.0](http://laravel.neptos.fr/docs/5.0)\r\n\r\nThis pull request is based on the pull request from @mattstauffer. It improves relevance, UX and adds instant search capabilities to the documentation using the [Algolia API](https://www.algolia.com/).\r\n\r\nYou will find a list of differences between the two pull requests at the end of this comment.\r\n\r\n## Benefits for the end user\r\n\r\n- Documentation search ALA [Devdocs](http://devdocs.io/).\r\n- Relevance and speed thanks to Algolia search service (your search index is replicated in 12 regions worldwide, it is fast no matter where the user is)\r\n- Instant access to the documentation content (pages, sections, ...) at the first keystroke, in a few milliseconds\r\n\r\n## How does it works\r\n\r\nThere's a free index at Algolia that hosts the documentation, when a user does a search we use the Algolia API and then map to the pages and section of the documentation.\r\n\r\nThe index is populated via an Artisan task (more on this below).\r\n\r\n## Testing the pull request locally\r\n\r\nIf you want to test this pull request on your machine, you can do this:\r\n\r\n```sh\r\ngit clone git@github.com:maxiloc/laravel.com.git\r\ncd laravel.com\r\ngit checkout add-documentation-search\r\ncomposer update\r\nphp artisan serve\r\n```\r\n\r\nNote:\r\nThis relies on your resources/docs/* Markdown folders being available locally.\r\n\r\n## Updating the index\r\n\r\nWhen doing documentation updates, to update the relevant Algolia index, do this:\r\n\r\n```sh\r\nALGOLIA_ADMIN_KEY=[YOUR_ALGOLIA_ADMIN_KEY] php artisan docs:index\r\n```\r\n\r\n@taylorotwell I am sending you a email with access to the Algolia's dashboard of the index.\r\nYou will then be able to get the `ALGOLIA_ADMIN_KEY` that will allow you to update the index (in the credentials dashboard).\r\nThis is your account, you are free to do whatever you want.\r\n\r\n## Differences with ElasticSearch pull-request (#18)\r\n\r\n### Relevance\r\n\r\nI cut each page in small parts (h1, h2, ...) and prioritize them in order to have good relevance. It also allows to go directly to the concerning anchor when selecting a suggestion.\r\n\r\n### UI/UX\r\n\r\nThis is an autocomplete implementation, which allow a quick access to content using only keyboard and do not need a page load to have the results.\r\n\r\n### Hosting\r\n\r\nThe elastic search solution requires us to host it and maintain it, while Algolia is a SAAS hosted it in 12 different regions.\r\n\r\n## Algolia\r\n\r\nWe already support other community websites like [Hackernews search](https://news.ycombinator.com/), [CDNJS](https://cdnjs.com/), [GrowthHackers](https://growthhackers.com/) or [Product hunt](http://www.producthunt.com/). In exchange, we only ask for a \"powered by Algolia\" in the search results. This pull request adds it too.\r\n\r\nIf you want to move forward with this implementation, we will of course give you the search account for free as explained before.\r\n\r\nPlease contact me if you have any question or would like more information.\r\n","created_at":"2015-05-27T12:50:00Z","updated_at":"2015-06-08T16:25:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1f4037c4181158b66468fdd8bea20e598e45507","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/laravel.com/pulls/37/commits","review_comments_url":"https://api.github.com/repos/laravel/laravel.com/pulls/37/comments","review_comment_url":"https://api.github.com/repos/laravel/laravel.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/laravel.com/issues/37/comments","statuses_url":"https://api.github.com/repos/laravel/laravel.com/statuses/b9ff772fc995c975497d46ef7f202b391167416e","head":{"label":"maxiloc:add-documentation-search","ref":"add-documentation-search","sha":"b9ff772fc995c975497d46ef7f202b391167416e","user":{"login":"maxiloc","id":1689007,"avatar_url":"https://avatars.githubusercontent.com/u/1689007?v=3","gravatar_id":"","url":"https://api.github.com/users/maxiloc","html_url":"https://github.com/maxiloc","followers_url":"https://api.github.com/users/maxiloc/followers","following_url":"https://api.github.com/users/maxiloc/following{/other_user}","gists_url":"https://api.github.com/users/maxiloc/gists{/gist_id}","starred_url":"https://api.github.com/users/maxiloc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxiloc/subscriptions","organizations_url":"https://api.github.com/users/maxiloc/orgs","repos_url":"https://api.github.com/users/maxiloc/repos","events_url":"https://api.github.com/users/maxiloc/events{/privacy}","received_events_url":"https://api.github.com/users/maxiloc/received_events","type":"User","site_admin":false},"repo":{"id":35935707,"name":"laravel.com","full_name":"maxiloc/laravel.com","owner":{"login":"maxiloc","id":1689007,"avatar_url":"https://avatars.githubusercontent.com/u/1689007?v=3","gravatar_id":"","url":"https://api.github.com/users/maxiloc","html_url":"https://github.com/maxiloc","followers_url":"https://api.github.com/users/maxiloc/followers","following_url":"https://api.github.com/users/maxiloc/following{/other_user}","gists_url":"https://api.github.com/users/maxiloc/gists{/gist_id}","starred_url":"https://api.github.com/users/maxiloc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxiloc/subscriptions","organizations_url":"https://api.github.com/users/maxiloc/orgs","repos_url":"https://api.github.com/users/maxiloc/repos","events_url":"https://api.github.com/users/maxiloc/events{/privacy}","received_events_url":"https://api.github.com/users/maxiloc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxiloc/laravel.com","description":"","fork":true,"url":"https://api.github.com/repos/maxiloc/laravel.com","forks_url":"https://api.github.com/repos/maxiloc/laravel.com/forks","keys_url":"https://api.github.com/repos/maxiloc/laravel.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxiloc/laravel.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxiloc/laravel.com/teams","hooks_url":"https://api.github.com/repos/maxiloc/laravel.com/hooks","issue_events_url":"https://api.github.com/repos/maxiloc/laravel.com/issues/events{/number}","events_url":"https://api.github.com/repos/maxiloc/laravel.com/events","assignees_url":"https://api.github.com/repos/maxiloc/laravel.com/assignees{/user}","branches_url":"https://api.github.com/repos/maxiloc/laravel.com/branches{/branch}","tags_url":"https://api.github.com/repos/maxiloc/laravel.com/tags","blobs_url":"https://api.github.com/repos/maxiloc/laravel.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxiloc/laravel.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxiloc/laravel.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxiloc/laravel.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxiloc/laravel.com/statuses/{sha}","languages_url":"https://api.github.com/repos/maxiloc/laravel.com/languages","stargazers_url":"https://api.github.com/repos/maxiloc/laravel.com/stargazers","contributors_url":"https://api.github.com/repos/maxiloc/laravel.com/contributors","subscribers_url":"https://api.github.com/repos/maxiloc/laravel.com/subscribers","subscription_url":"https://api.github.com/repos/maxiloc/laravel.com/subscription","commits_url":"https://api.github.com/repos/maxiloc/laravel.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxiloc/laravel.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxiloc/laravel.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxiloc/laravel.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxiloc/laravel.com/contents/{+path}","compare_url":"https://api.github.com/repos/maxiloc/laravel.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxiloc/laravel.com/merges","archive_url":"https://api.github.com/repos/maxiloc/laravel.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxiloc/laravel.com/downloads","issues_url":"https://api.github.com/repos/maxiloc/laravel.com/issues{/number}","pulls_url":"https://api.github.com/repos/maxiloc/laravel.com/pulls{/number}","milestones_url":"https://api.github.com/repos/maxiloc/laravel.com/milestones{/number}","notifications_url":"https://api.github.com/repos/maxiloc/laravel.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxiloc/laravel.com/labels{/name}","releases_url":"https://api.github.com/repos/maxiloc/laravel.com/releases{/id}","created_at":"2015-05-20T08:29:22Z","updated_at":"2015-05-26T08:53:28Z","pushed_at":"2015-06-06T12:42:20Z","git_url":"git://github.com/maxiloc/laravel.com.git","ssh_url":"git@github.com:maxiloc/laravel.com.git","clone_url":"https://github.com/maxiloc/laravel.com.git","svn_url":"https://github.com/maxiloc/laravel.com","homepage":null,"size":3997,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"laravel:master","ref":"master","sha":"ffc7fce8f34ad698215c8e4bd4ba825251fc5a41","user":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"repo":{"id":24334457,"name":"laravel.com","full_name":"laravel/laravel.com","owner":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/laravel/laravel.com","description":"","fork":false,"url":"https://api.github.com/repos/laravel/laravel.com","forks_url":"https://api.github.com/repos/laravel/laravel.com/forks","keys_url":"https://api.github.com/repos/laravel/laravel.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/laravel.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/laravel.com/teams","hooks_url":"https://api.github.com/repos/laravel/laravel.com/hooks","issue_events_url":"https://api.github.com/repos/laravel/laravel.com/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/laravel.com/events","assignees_url":"https://api.github.com/repos/laravel/laravel.com/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/laravel.com/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/laravel.com/tags","blobs_url":"https://api.github.com/repos/laravel/laravel.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/laravel.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/laravel.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/laravel.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/laravel.com/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/laravel.com/languages","stargazers_url":"https://api.github.com/repos/laravel/laravel.com/stargazers","contributors_url":"https://api.github.com/repos/laravel/laravel.com/contributors","subscribers_url":"https://api.github.com/repos/laravel/laravel.com/subscribers","subscription_url":"https://api.github.com/repos/laravel/laravel.com/subscription","commits_url":"https://api.github.com/repos/laravel/laravel.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/laravel.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/laravel.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/laravel.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/laravel.com/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/laravel.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/laravel.com/merges","archive_url":"https://api.github.com/repos/laravel/laravel.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/laravel.com/downloads","issues_url":"https://api.github.com/repos/laravel/laravel.com/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/laravel.com/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/laravel.com/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/laravel.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/laravel.com/labels{/name}","releases_url":"https://api.github.com/repos/laravel/laravel.com/releases{/id}","created_at":"2014-09-22T15:35:00Z","updated_at":"2015-05-23T13:40:55Z","pushed_at":"2015-06-06T12:42:20Z","git_url":"git://github.com/laravel/laravel.com.git","ssh_url":"git@github.com:laravel/laravel.com.git","clone_url":"https://github.com/laravel/laravel.com.git","svn_url":"https://github.com/laravel/laravel.com","homepage":null,"size":4500,"stargazers_count":50,"watchers_count":50,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":1,"forks":85,"open_issues":1,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/37"},"html":{"href":"https://github.com/laravel/laravel.com/pull/37"},"issue":{"href":"https://api.github.com/repos/laravel/laravel.com/issues/37"},"comments":{"href":"https://api.github.com/repos/laravel/laravel.com/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/laravel.com/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/laravel.com/statuses/b9ff772fc995c975497d46ef7f202b391167416e"}}}}