{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/9451","labels_url":"https://api.github.com/repos/laravel/framework/issues/9451/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/9451/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/9451/events","html_url":"https://github.com/laravel/framework/pull/9451","id":91786580,"number":9451,"title":"[5.1]  Allow callbacks in Collection min and max method","user":{"login":"BosAtWork","id":7517267,"avatar_url":"https://avatars.githubusercontent.com/u/7517267?v=3","gravatar_id":"","url":"https://api.github.com/users/BosAtWork","html_url":"https://github.com/BosAtWork","followers_url":"https://api.github.com/users/BosAtWork/followers","following_url":"https://api.github.com/users/BosAtWork/following{/other_user}","gists_url":"https://api.github.com/users/BosAtWork/gists{/gist_id}","starred_url":"https://api.github.com/users/BosAtWork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BosAtWork/subscriptions","organizations_url":"https://api.github.com/users/BosAtWork/orgs","repos_url":"https://api.github.com/users/BosAtWork/repos","events_url":"https://api.github.com/users/BosAtWork/events{/privacy}","received_events_url":"https://api.github.com/users/BosAtWork/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-29T12:11:51Z","updated_at":"2015-06-29T21:03:57Z","closed_at":"2015-06-29T21:03:56Z","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/9451","html_url":"https://github.com/laravel/framework/pull/9451","diff_url":"https://github.com/laravel/framework/pull/9451.diff","patch_url":"https://github.com/laravel/framework/pull/9451.patch"},"body":"The sum method on Collections allow the developer to pass a nothing, string and callable. This allow the developer to be more flexible to calculate the sum.\r\n\r\nThe max and min method's only allowed a key and the implementation was not the same as the sum method. I have implemented the sum method in the same way as the min and max methods.\r\n\r\nAlso changed the tests to reflect more closely to the sum methods.\r\n\r\nNote: min and max in php will throw a warning on empty collection where array_sum doesn't. So extra check was required on the length of the array."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/116846003","html_url":"https://github.com/laravel/framework/pull/9451#issuecomment-116846003","issue_url":"https://api.github.com/repos/laravel/framework/issues/9451","id":116846003,"user":{"login":"taylorotwell","id":463230,"avatar_url":"https://avatars.githubusercontent.com/u/463230?v=3","gravatar_id":"","url":"https://api.github.com/users/taylorotwell","html_url":"https://github.com/taylorotwell","followers_url":"https://api.github.com/users/taylorotwell/followers","following_url":"https://api.github.com/users/taylorotwell/following{/other_user}","gists_url":"https://api.github.com/users/taylorotwell/gists{/gist_id}","starred_url":"https://api.github.com/users/taylorotwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taylorotwell/subscriptions","organizations_url":"https://api.github.com/users/taylorotwell/orgs","repos_url":"https://api.github.com/users/taylorotwell/repos","events_url":"https://api.github.com/users/taylorotwell/events{/privacy}","received_events_url":"https://api.github.com/users/taylorotwell/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T21:03:56Z","updated_at":"2015-06-29T21:03:56Z","body":"You can just use `reduce` for this instead of changing the behavior of this function."}}