{"action":"created","issue":{"url":"https://api.github.com/repos/dingo/api/issues/348","labels_url":"https://api.github.com/repos/dingo/api/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/348/comments","events_url":"https://api.github.com/repos/dingo/api/issues/348/events","html_url":"https://github.com/dingo/api/issues/348","id":55495769,"number":348,"title":"Type hinting is required for the first param of the method ResponseFactory::collection!","user":{"login":"ivorobioff","id":563937,"avatar_url":"https://avatars.githubusercontent.com/u/563937?v=3","gravatar_id":"","url":"https://api.github.com/users/ivorobioff","html_url":"https://github.com/ivorobioff","followers_url":"https://api.github.com/users/ivorobioff/followers","following_url":"https://api.github.com/users/ivorobioff/following{/other_user}","gists_url":"https://api.github.com/users/ivorobioff/gists{/gist_id}","starred_url":"https://api.github.com/users/ivorobioff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivorobioff/subscriptions","organizations_url":"https://api.github.com/users/ivorobioff/orgs","repos_url":"https://api.github.com/users/ivorobioff/repos","events_url":"https://api.github.com/users/ivorobioff/events{/privacy}","received_events_url":"https://api.github.com/users/ivorobioff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-26T15:32:55Z","updated_at":"2015-01-26T21:48:44Z","closed_at":null,"body":"```php\r\npublic function collection($collection, $transformer, array $parameters = [], Closure $after = null)\r\n    {\r\n        $class = get_class($collection->first());\r\n\r\n        $binding = $this->transformer->register($class, $transformer, $parameters, $after);\r\n\r\n        return new ResponseBuilder($collection, $binding);\r\n    }\r\n```\r\n\r\nWhen calling this method from the controller it's not obvious what type of the object the method accepts as a collection. It will be very helpful to specify the \"Illuminate\\Database\\Eloquent $collection\" so that developers know what to put there in case when data retrieved from \"Eloquent\" not going directly there. "},"comment":{"url":"https://api.github.com/repos/dingo/api/issues/comments/71545366","html_url":"https://github.com/dingo/api/issues/348#issuecomment-71545366","issue_url":"https://api.github.com/repos/dingo/api/issues/348","id":71545366,"user":{"login":"bweston92","id":1764057,"avatar_url":"https://avatars.githubusercontent.com/u/1764057?v=3","gravatar_id":"","url":"https://api.github.com/users/bweston92","html_url":"https://github.com/bweston92","followers_url":"https://api.github.com/users/bweston92/followers","following_url":"https://api.github.com/users/bweston92/following{/other_user}","gists_url":"https://api.github.com/users/bweston92/gists{/gist_id}","starred_url":"https://api.github.com/users/bweston92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bweston92/subscriptions","organizations_url":"https://api.github.com/users/bweston92/orgs","repos_url":"https://api.github.com/users/bweston92/repos","events_url":"https://api.github.com/users/bweston92/events{/privacy}","received_events_url":"https://api.github.com/users/bweston92/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T21:48:43Z","updated_at":"2015-01-26T21:48:43Z","body":"Actually anything that is iterateable is a collection. A standard array, Illuminate\\Support\\Collection and its children (database collection), why limit it to just one type?\r\n\r\n—\r\nSent from Mailbox\r\n\r\nOn Mon, Jan 26, 2015 at 3:32 PM, Igor Vorobiov <notifications@github.com>\r\nwrote:\r\n\r\n> ```php\r\n> public function collection($collection, $transformer, array $parameters = [], Closure $after = null)\r\n>     {\r\n>         $class = get_class($collection->first());\r\n>         $binding = $this->transformer->register($class, $transformer, $parameters, $after);\r\n>         return new ResponseBuilder($collection, $binding);\r\n>     }\r\n> ```\r\n> When calling this method from the controller it's not obvious what type of the object the method accepts as a collection. It will be very helpful to specify the \"Illuminate\\Database\\Eloquent $collection\" so that developers know what to put there in case when data retrieved from \"Eloquent\" not going directly there. \r\n> ---\r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/dingo/api/issues/348"}}