{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/docs/issues/3523","repository_url":"https://api.github.com/repos/laravel/docs","labels_url":"https://api.github.com/repos/laravel/docs/issues/3523/labels{/name}","comments_url":"https://api.github.com/repos/laravel/docs/issues/3523/comments","events_url":"https://api.github.com/repos/laravel/docs/issues/3523/events","html_url":"https://github.com/laravel/docs/issues/3523","id":250740179,"node_id":"MDU6SXNzdWUyNTA3NDAxNzk=","number":3523,"title":"Missing tip in collection forPage doc","user":{"login":"srobati","id":2736646,"node_id":"MDQ6VXNlcjI3MzY2NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/2736646?v=4","gravatar_id":"","url":"https://api.github.com/users/srobati","html_url":"https://github.com/srobati","followers_url":"https://api.github.com/users/srobati/followers","following_url":"https://api.github.com/users/srobati/following{/other_user}","gists_url":"https://api.github.com/users/srobati/gists{/gist_id}","starred_url":"https://api.github.com/users/srobati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srobati/subscriptions","organizations_url":"https://api.github.com/users/srobati/orgs","repos_url":"https://api.github.com/users/srobati/repos","events_url":"https://api.github.com/users/srobati/events{/privacy}","received_events_url":"https://api.github.com/users/srobati/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-08-16T19:52:16Z","updated_at":"2018-10-31T09:37:03Z","closed_at":"2018-02-17T07:50:45Z","author_association":"CONTRIBUTOR","body":"Hi,\r\nI wanted to return the paginated items from eloquent, so i read the `forPage` docs and did the following:\r\n```php\r\n$result = $collection->forPage($page, $size)->all();\r\n//return $result\r\n```\r\nbut json response for `$page > 1` was json object instead of array!!!\r\nafter some try i found that the following code is the correct way to return paginated result:\r\n```php\r\n$result = $collection->forPage($page, $size)->values()->all();\r\n//return $result\r\n```\r\n\r\nIt is better to mention  that the `forPage` preserve keys and the json result may be object instead of array and for array result `values` must be used after `forPage`."},"comment":{"url":"https://api.github.com/repos/laravel/docs/issues/comments/434620810","html_url":"https://github.com/laravel/docs/issues/3523#issuecomment-434620810","issue_url":"https://api.github.com/repos/laravel/docs/issues/3523","id":434620810,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDYyMDgxMA==","user":{"login":"MikeSheward","id":2095899,"node_id":"MDQ6VXNlcjIwOTU4OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2095899?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeSheward","html_url":"https://github.com/MikeSheward","followers_url":"https://api.github.com/users/MikeSheward/followers","following_url":"https://api.github.com/users/MikeSheward/following{/other_user}","gists_url":"https://api.github.com/users/MikeSheward/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeSheward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeSheward/subscriptions","organizations_url":"https://api.github.com/users/MikeSheward/orgs","repos_url":"https://api.github.com/users/MikeSheward/repos","events_url":"https://api.github.com/users/MikeSheward/events{/privacy}","received_events_url":"https://api.github.com/users/MikeSheward/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T09:37:03Z","updated_at":"2018-10-31T09:37:03Z","author_association":"NONE","body":"Thanks this helped! Sometimes it would return an array, and another an object!"}}
{"actor":{"display_login":"MikeSheward"}}