{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/10602","labels_url":"https://api.github.com/repos/laravel/framework/issues/10602/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/10602/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/10602/events","html_url":"https://github.com/laravel/framework/issues/10602","id":111447116,"number":10602,"title":"[Suggestion] Arr::random() method","user":{"login":"vlakoff","id":544424,"avatar_url":"https://avatars.githubusercontent.com/u/544424?v=3","gravatar_id":"","url":"https://api.github.com/users/vlakoff","html_url":"https://github.com/vlakoff","followers_url":"https://api.github.com/users/vlakoff/followers","following_url":"https://api.github.com/users/vlakoff/following{/other_user}","gists_url":"https://api.github.com/users/vlakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vlakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlakoff/subscriptions","organizations_url":"https://api.github.com/users/vlakoff/orgs","repos_url":"https://api.github.com/users/vlakoff/repos","events_url":"https://api.github.com/users/vlakoff/events{/privacy}","received_events_url":"https://api.github.com/users/vlakoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-14T17:19:26Z","updated_at":"2015-10-15T09:15:15Z","closed_at":"2015-10-15T09:15:15Z","body":"Because the native [`array_rand()`](http://php.net/manual/en/function.array-rand.php) may be a bit unintuitive as it returns keys (which we don't need in most cases), and more importantly, using it often appears to be somewhat verbose: `$readConfig['host'][array_rand($readConfig['host'])]`, and it gets worse when getting several items.\r\n\r\nIt would basically be the same as [`Collection::random()`](https://github.com/laravel/framework/blob/5.1/src/Illuminate/Support/Collection.php). But directly on array, thus removing the need to create a collection only for this :)\r\n\r\nWas already asked in #8330 (but with support for picking only one item)"}}