{"action":"created","issue":{"url":"https://api.github.com/repos/dingo/api/issues/442","labels_url":"https://api.github.com/repos/dingo/api/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/442/comments","events_url":"https://api.github.com/repos/dingo/api/issues/442/events","html_url":"https://github.com/dingo/api/issues/442","id":83401313,"number":442,"title":"transformer for Responding With A Collection Of Items","user":{"login":"donnigunawan","id":6318528,"avatar_url":"https://avatars.githubusercontent.com/u/6318528?v=3","gravatar_id":"","url":"https://api.github.com/users/donnigunawan","html_url":"https://github.com/donnigunawan","followers_url":"https://api.github.com/users/donnigunawan/followers","following_url":"https://api.github.com/users/donnigunawan/following{/other_user}","gists_url":"https://api.github.com/users/donnigunawan/gists{/gist_id}","starred_url":"https://api.github.com/users/donnigunawan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnigunawan/subscriptions","organizations_url":"https://api.github.com/users/donnigunawan/orgs","repos_url":"https://api.github.com/users/donnigunawan/repos","events_url":"https://api.github.com/users/donnigunawan/events{/privacy}","received_events_url":"https://api.github.com/users/donnigunawan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-01T09:17:42Z","updated_at":"2015-06-01T09:43:17Z","closed_at":null,"body":"Hi, I have no idea on how to use transformer class for Responding With A Collection Of Items. I tried another response and it works but now the Responding With A Collection Of Items.\r\nHere is my code, I select all group from database : \r\n\r\nin UserController.php : \r\nclass UserController extends BaseController\r\n{\r\n    public function show()\r\n    {\r\n\t\t//use ControllerTrait;\r\n        $group = Sentry::findGroupById(1);\r\n\r\n        return $this->response->collection($group, new GroupTransformer);\r\n    }\r\n}\r\n\r\nthe transformer class is in app/transformer/GroupTransormer.php : \r\n\r\nuse League\\Fractal\\TransformerAbstract;\r\n\r\nclass GroupTransformer extends TransformerAbstract\r\n{\r\n\r\n    /**\r\n     * Turn this item object into a generic array\r\n     *\r\n     * @return array\r\n     */\r\n    public function transform(User $user)\r\n    {\r\n        return [\r\n            'id'            => (int) $user->id,\r\n            'name'          => $user->name,\r\n            'permissions'         => $user->permissions,\r\n        ];\r\n    }\r\n\r\n}\r\n\r\nThen when I access, I got this error : \r\n\r\nErrorException thrown with message \"Argument 1 passed to Dingo\\Api\\Http\\ResponseFactory::collection() must be an instance of Illuminate\\Support\\Collection, instance of Cartalyst\\Sentry\\Groups\\Eloquent\\Group given, called in /var/www/my-app/app/controllers/UserController.php on line 12 and defined\"\r\n\r\nStacktrace:\r\n#20 ErrorException in /var/www/my-app/vendor/dingo/api/src/Http/ResponseFactory.php:75\r\n#19 Illuminate\\Exception\\Handler:handleError in /var/www/my-app/vendor/dingo/api/src/Http/ResponseFactory.php:75\r\n#18 Dingo\\Api\\Http\\ResponseFactory:collection in /var/www/my-app/app/controllers/UserController.php:12\r\n#17 UserController:show in <#unknown>:0\r\n#16 call_user_func_array in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:231\r\n#15 Illuminate\\Routing\\Controller:callAction in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:93\r\n#14 Illuminate\\Routing\\ControllerDispatcher:call in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:62\r\n#13 Illuminate\\Routing\\ControllerDispatcher:dispatch in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:967\r\n#12 Illuminate\\Routing\\Router:Illuminate\\Routing\\{closure} in <#unknown>:0\r\n#11 call_user_func_array in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/Route.php:109\r\n#10 Illuminate\\Routing\\Route:run in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1033\r\n#9 Illuminate\\Routing\\Router:dispatchToRoute in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1001\r\n#8 Illuminate\\Routing\\Router:dispatch in /var/www/my-app/vendor/dingo/api/src/Routing/Router.php:205\r\n#7 Dingo\\Api\\Routing\\Router:dispatch in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:775\r\n#6 Illuminate\\Foundation\\Application:dispatch in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:745\r\n#5 Illuminate\\Foundation\\Application:handle in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Session/Middleware.php:72\r\n#4 Illuminate\\Session\\Middleware:handle in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php:47\r\n#3 Illuminate\\Cookie\\Queue:handle in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php:51\r\n#2 Illuminate\\Cookie\\Guard:handle in /var/www/my-app/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23\r\n#1 Stack\\StackedHttpKernel:handle in /var/www/my-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:641\r\n#0 Illuminate\\Foundation\\Application:run in /var/www/my-app/public/index.php:49\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dingo/api/issues/comments/107382767","html_url":"https://github.com/dingo/api/issues/442#issuecomment-107382767","issue_url":"https://api.github.com/repos/dingo/api/issues/442","id":107382767,"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-06-01T09:43:17Z","updated_at":"2015-06-01T09:43:17Z","body":"After looking at Sentry, I've noticed you're passing a single model not a collection into the response builder."}}