{"action":"created","comment":{"url":"https://api.github.com/repos/laravel/docs/pulls/comments/40496356","id":40496356,"diff_hunk":"@@ -123,6 +124,26 @@ The `all` method simply returns the underlying array represented by the collecti\n \n     // [1, 2, 3]\n \n+<a name=\"method-avg\"></a>\n+#### `avg()` {#collection-method}\n+\n+The `avg` method returns the average of all items in the collection:\n+\n+    collect([1, 2, 3, 4, 5])->avg();\n+\n+    // 3\n+\n+If the collection contains nested arrays or objects, you should pass a key to use for determining which values to sum:","path":"collections.md","position":21,"original_position":21,"commit_id":"aae2bd49fda97247bc86b71a72a04f12c3c288ee","original_commit_id":"aae2bd49fda97247bc86b71a72a04f12c3c288ee","user":{"login":"fonini","id":215885,"avatar_url":"https://avatars.githubusercontent.com/u/215885?v=3","gravatar_id":"","url":"https://api.github.com/users/fonini","html_url":"https://github.com/fonini","followers_url":"https://api.github.com/users/fonini/followers","following_url":"https://api.github.com/users/fonini/following{/other_user}","gists_url":"https://api.github.com/users/fonini/gists{/gist_id}","starred_url":"https://api.github.com/users/fonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonini/subscriptions","organizations_url":"https://api.github.com/users/fonini/orgs","repos_url":"https://api.github.com/users/fonini/repos","events_url":"https://api.github.com/users/fonini/events{/privacy}","received_events_url":"https://api.github.com/users/fonini/received_events","type":"User","site_admin":false},"body":"Sorry, which values to avg(). Unfortunatelly, I can't fix it right now.\nEm 26/09/2015 14:51, \"Taylor Otwell\" <notifications@github.com> escreveu:\n\n> In collections.md\n> <https://github.com/laravel/docs/pull/1812#discussion_r40496252>:\n>\n> > @@ -123,6 +124,26 @@ The `all` method simply returns the underlying array represented by the collecti\n> >\n> >      // [1, 2, 3]\n> >\n> > +<a name=\"method-avg\"></a>\n> > +#### `avg()` {#collection-method}\n> > +\n> > +The `avg` method returns the average of all items in the collection:\n> > +\n> > +    collect([1, 2, 3, 4, 5])->avg();\n> > +\n> > +    // 3\n> > +\n> > +If the collection contains nested arrays or objects, you should pass a key to use for determining which values to sum:\n>\n> Which values to sum or which values to avg?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/laravel/docs/pull/1812/files#r40496252>.\n>\n","created_at":"2015-09-26T18:00:05Z","updated_at":"2015-09-26T18:00:05Z","html_url":"https://github.com/laravel/docs/pull/1812#discussion_r40496356","pull_request_url":"https://api.github.com/repos/laravel/docs/pulls/1812","_links":{"self":{"href":"https://api.github.com/repos/laravel/docs/pulls/comments/40496356"},"html":{"href":"https://github.com/laravel/docs/pull/1812#discussion_r40496356"},"pull_request":{"href":"https://api.github.com/repos/laravel/docs/pulls/1812"}}},"pull_request":{"url":"https://api.github.com/repos/laravel/docs/pulls/1812","id":46053011,"html_url":"https://github.com/laravel/docs/pull/1812","diff_url":"https://github.com/laravel/docs/pull/1812.diff","patch_url":"https://github.com/laravel/docs/pull/1812.patch","issue_url":"https://api.github.com/repos/laravel/docs/issues/1812","number":1812,"state":"open","locked":false,"title":"Docs for avg() method","user":{"login":"fonini","id":215885,"avatar_url":"https://avatars.githubusercontent.com/u/215885?v=3","gravatar_id":"","url":"https://api.github.com/users/fonini","html_url":"https://github.com/fonini","followers_url":"https://api.github.com/users/fonini/followers","following_url":"https://api.github.com/users/fonini/following{/other_user}","gists_url":"https://api.github.com/users/fonini/gists{/gist_id}","starred_url":"https://api.github.com/users/fonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonini/subscriptions","organizations_url":"https://api.github.com/users/fonini/orgs","repos_url":"https://api.github.com/users/fonini/repos","events_url":"https://api.github.com/users/fonini/events{/privacy}","received_events_url":"https://api.github.com/users/fonini/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-25T20:12:26Z","updated_at":"2015-09-26T18:00:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e07aaac7b1de5717d77ecbcaa894bcbc7ab8af49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/docs/pulls/1812/commits","review_comments_url":"https://api.github.com/repos/laravel/docs/pulls/1812/comments","review_comment_url":"https://api.github.com/repos/laravel/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/docs/issues/1812/comments","statuses_url":"https://api.github.com/repos/laravel/docs/statuses/aae2bd49fda97247bc86b71a72a04f12c3c288ee","head":{"label":"fonini:5.1","ref":"5.1","sha":"aae2bd49fda97247bc86b71a72a04f12c3c288ee","user":{"login":"fonini","id":215885,"avatar_url":"https://avatars.githubusercontent.com/u/215885?v=3","gravatar_id":"","url":"https://api.github.com/users/fonini","html_url":"https://github.com/fonini","followers_url":"https://api.github.com/users/fonini/followers","following_url":"https://api.github.com/users/fonini/following{/other_user}","gists_url":"https://api.github.com/users/fonini/gists{/gist_id}","starred_url":"https://api.github.com/users/fonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonini/subscriptions","organizations_url":"https://api.github.com/users/fonini/orgs","repos_url":"https://api.github.com/users/fonini/repos","events_url":"https://api.github.com/users/fonini/events{/privacy}","received_events_url":"https://api.github.com/users/fonini/received_events","type":"User","site_admin":false},"repo":{"id":43172786,"name":"docs","full_name":"fonini/docs","owner":{"login":"fonini","id":215885,"avatar_url":"https://avatars.githubusercontent.com/u/215885?v=3","gravatar_id":"","url":"https://api.github.com/users/fonini","html_url":"https://github.com/fonini","followers_url":"https://api.github.com/users/fonini/followers","following_url":"https://api.github.com/users/fonini/following{/other_user}","gists_url":"https://api.github.com/users/fonini/gists{/gist_id}","starred_url":"https://api.github.com/users/fonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonini/subscriptions","organizations_url":"https://api.github.com/users/fonini/orgs","repos_url":"https://api.github.com/users/fonini/repos","events_url":"https://api.github.com/users/fonini/events{/privacy}","received_events_url":"https://api.github.com/users/fonini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fonini/docs","description":"","fork":true,"url":"https://api.github.com/repos/fonini/docs","forks_url":"https://api.github.com/repos/fonini/docs/forks","keys_url":"https://api.github.com/repos/fonini/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fonini/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fonini/docs/teams","hooks_url":"https://api.github.com/repos/fonini/docs/hooks","issue_events_url":"https://api.github.com/repos/fonini/docs/issues/events{/number}","events_url":"https://api.github.com/repos/fonini/docs/events","assignees_url":"https://api.github.com/repos/fonini/docs/assignees{/user}","branches_url":"https://api.github.com/repos/fonini/docs/branches{/branch}","tags_url":"https://api.github.com/repos/fonini/docs/tags","blobs_url":"https://api.github.com/repos/fonini/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fonini/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fonini/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/fonini/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fonini/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/fonini/docs/languages","stargazers_url":"https://api.github.com/repos/fonini/docs/stargazers","contributors_url":"https://api.github.com/repos/fonini/docs/contributors","subscribers_url":"https://api.github.com/repos/fonini/docs/subscribers","subscription_url":"https://api.github.com/repos/fonini/docs/subscription","commits_url":"https://api.github.com/repos/fonini/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/fonini/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/fonini/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/fonini/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/fonini/docs/contents/{+path}","compare_url":"https://api.github.com/repos/fonini/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fonini/docs/merges","archive_url":"https://api.github.com/repos/fonini/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fonini/docs/downloads","issues_url":"https://api.github.com/repos/fonini/docs/issues{/number}","pulls_url":"https://api.github.com/repos/fonini/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/fonini/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/fonini/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fonini/docs/labels{/name}","releases_url":"https://api.github.com/repos/fonini/docs/releases{/id}","created_at":"2015-09-25T19:59:37Z","updated_at":"2015-09-24T13:43:16Z","pushed_at":"2015-09-25T20:08:58Z","git_url":"git://github.com/fonini/docs.git","ssh_url":"git@github.com:fonini/docs.git","clone_url":"https://github.com/fonini/docs.git","svn_url":"https://github.com/fonini/docs","homepage":"","size":16287,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.1"}},"base":{"label":"laravel:5.1","ref":"5.1","sha":"8de85e5b1522c324cee88788c7e09c560f1ea4b8","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":7546847,"name":"docs","full_name":"laravel/docs","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/docs","description":"","fork":false,"url":"https://api.github.com/repos/laravel/docs","forks_url":"https://api.github.com/repos/laravel/docs/forks","keys_url":"https://api.github.com/repos/laravel/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/docs/teams","hooks_url":"https://api.github.com/repos/laravel/docs/hooks","issue_events_url":"https://api.github.com/repos/laravel/docs/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/docs/events","assignees_url":"https://api.github.com/repos/laravel/docs/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/docs/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/docs/tags","blobs_url":"https://api.github.com/repos/laravel/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/docs/languages","stargazers_url":"https://api.github.com/repos/laravel/docs/stargazers","contributors_url":"https://api.github.com/repos/laravel/docs/contributors","subscribers_url":"https://api.github.com/repos/laravel/docs/subscribers","subscription_url":"https://api.github.com/repos/laravel/docs/subscription","commits_url":"https://api.github.com/repos/laravel/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/docs/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/docs/merges","archive_url":"https://api.github.com/repos/laravel/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/docs/downloads","issues_url":"https://api.github.com/repos/laravel/docs/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/docs/labels{/name}","releases_url":"https://api.github.com/repos/laravel/docs/releases{/id}","created_at":"2013-01-10T19:08:45Z","updated_at":"2015-09-24T13:43:16Z","pushed_at":"2015-09-25T20:12:27Z","git_url":"git://github.com/laravel/docs.git","ssh_url":"git@github.com:laravel/docs.git","clone_url":"https://github.com/laravel/docs.git","svn_url":"https://github.com/laravel/docs","homepage":"","size":16287,"stargazers_count":530,"watchers_count":530,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1375,"mirror_url":null,"open_issues_count":50,"forks":1375,"open_issues":50,"watchers":530,"default_branch":"5.1"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/docs/pulls/1812"},"html":{"href":"https://github.com/laravel/docs/pull/1812"},"issue":{"href":"https://api.github.com/repos/laravel/docs/issues/1812"},"comments":{"href":"https://api.github.com/repos/laravel/docs/issues/1812/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/docs/pulls/1812/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/docs/pulls/1812/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/docs/statuses/aae2bd49fda97247bc86b71a72a04f12c3c288ee"}}}}