{"action":"closed","issue":{"url":"https://api.github.com/repos/dingo/api/issues/462","labels_url":"https://api.github.com/repos/dingo/api/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/462/comments","events_url":"https://api.github.com/repos/dingo/api/issues/462/events","html_url":"https://github.com/dingo/api/issues/462","id":87308685,"number":462,"title":"[L5] Request validation breaks router","user":{"login":"esbenp","id":934819,"avatar_url":"https://avatars.githubusercontent.com/u/934819?v=3","gravatar_id":"","url":"https://api.github.com/users/esbenp","html_url":"https://github.com/esbenp","followers_url":"https://api.github.com/users/esbenp/followers","following_url":"https://api.github.com/users/esbenp/following{/other_user}","gists_url":"https://api.github.com/users/esbenp/gists{/gist_id}","starred_url":"https://api.github.com/users/esbenp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esbenp/subscriptions","organizations_url":"https://api.github.com/users/esbenp/orgs","repos_url":"https://api.github.com/users/esbenp/repos","events_url":"https://api.github.com/users/esbenp/events{/privacy}","received_events_url":"https://api.github.com/users/esbenp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-06-11T11:22:13Z","updated_at":"2015-08-03T10:28:38Z","closed_at":"2015-08-03T10:28:38Z","body":"If I make input validation on a request using a request class like so \r\n\r\n```\r\n<?php namespace App\\Http\\Requests;\r\n\r\nuse App\\Http\\Requests\\Request;\r\n\r\nclass LoginRequest extends Request {\r\n\r\n    /**\r\n     * Determine if the user is authorized to make this request.\r\n     *\r\n     * @return bool\r\n     */\r\n    public function authorize()\r\n    {\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * Get the validation rules that apply to the request.\r\n     *\r\n     * @return array\r\n     */\r\n    public function rules()\r\n    {\r\n        return [\r\n            'email'    => 'required|email' ,\r\n            'password' => 'required'\r\n        ];\r\n    }\r\n\r\n}\r\n```\r\n\r\nit breaks the router on invalid input. The request class will issue a `RedirectResponse` and the Dingo router is expecting a normal `Response` resulting in the following exception being thrown.\r\n\r\n```\r\nArgument 1 passed to Dingo\\\\Api\\\\Http\\\\Response::makeFromExisting() must be an instance of Illuminate\\\\Http\\\\Response, instance of Illuminate\\\\Http\\\\RedirectResponse given, called in \\/home\\/vagrant\\/code\\/traede-l5\\/vendor\\/dingo\\/api\\/src\\/Routing\\/Router.php on line 551 and defined\r\n```\r\n\r\nI don't know if changing the type hinting to `Symfony\\Component\\HttpFoundation\\Response` and dropping the `getOriginalContent` for a `getContent` is a valid solution. I tried it out and it seemed to work, however I did not thoroughly test it.\r\n\r\n`Dingo\\Api\\Http\\Response`\r\n```\r\npublic static function makeFromExisting(\\Symfony\\Component\\HttpFoundation\\Response $old)\r\n    {\r\n        $new = static::create($old->getContent(), $old->getStatusCode());\r\n\r\n        $new->headers = $old->headers;\r\n\r\n        return $new;\r\n    }\r\n```"}}