{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/21920","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/21920/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/21920/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/21920/events","html_url":"https://github.com/laravel/framework/issues/21920","id":270632053,"number":21920,"title":"Max items for validate in a Custom Request?","user":{"login":"Albvadi","id":6285255,"avatar_url":"https://avatars3.githubusercontent.com/u/6285255?v=4","gravatar_id":"","url":"https://api.github.com/users/Albvadi","html_url":"https://github.com/Albvadi","followers_url":"https://api.github.com/users/Albvadi/followers","following_url":"https://api.github.com/users/Albvadi/following{/other_user}","gists_url":"https://api.github.com/users/Albvadi/gists{/gist_id}","starred_url":"https://api.github.com/users/Albvadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Albvadi/subscriptions","organizations_url":"https://api.github.com/users/Albvadi/orgs","repos_url":"https://api.github.com/users/Albvadi/repos","events_url":"https://api.github.com/users/Albvadi/events{/privacy}","received_events_url":"https://api.github.com/users/Albvadi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-02T12:14:58Z","updated_at":"2017-11-02T12:14:58Z","closed_at":null,"author_association":"NONE","body":"- Laravel Version: 5.5.15\r\n- PHP Version: 7.0.9\r\n- Database Driver & Version: No matters\r\n- Enviroment: Windows 7 + XAMPP Version 7.0.9\r\n\r\n### Description:\r\nHi,\r\nI have problems validating form fields with a custom request.\r\nIf the form has more than 15 fields, the validation simply breaks, and reload the page without errors. \r\nIf has less, he page it´s reload with all errors correctly.\r\nAnd, If the route only contains the validator... works well again.\r\n\r\n### Steps To Reproduce:\r\nRoutes (web.php)\r\n```PHP\r\nRoute::view('/test_validation', 'validation.index');\r\nRoute::post('/test_validation', 'ValidationController@testValidation')->name('testvalidation');\r\n```\r\nView (validation\\index.blade.php)\r\n```Blade\r\n@extends('layouts.app')\r\n\r\n@section('content')\r\n    <div class=\"container\">\r\n\r\n        @if($errors->any())\r\n            <div class=\"row\">\r\n                <div class=\"col-md-8 col-md-offset-2\">\r\n                    <div class=\"alert alert-danger\" role=\"alert\">\r\n                        <p><strong>There are errors:</strong></p>\r\n                        <ul>\r\n                            @foreach($errors->all() as $error)\r\n                                <li>{{$error}}</li>\r\n                            @endforeach\r\n                        </ul>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        @endif\r\n\r\n        <div class=\"row\">\r\n            <div class=\"col-md-10 col-md-offset-1\">\r\n                {{ Form::open(['route' => ['testvalidation'], 'method' => 'POST']) }}\r\n                <div class=\"panel panel-default\">\r\n                    <div class=\"panel-heading\">DATOS</div>\r\n\r\n                    <div class=\"panel-body\">\r\n\r\n                        @for ($i = 1; $i <= 20; $i++)\r\n                            <div class=\"col-md-2 {{ $errors->has('field_' . $i) ? ' has-error' : '' }}\">\r\n                                {{ Form::label('field_' . $i, 'Field ' . $i, ['class' => 'control-label']) }}\r\n                                {{ Form::text('field_' . $i, null, ['class' => 'form-control']) }}\r\n                            </div>\r\n                        @endfor\r\n\r\n                    </div>\r\n                </div>\r\n                <div class=\"row text-center\">\r\n                    <div class=\"col-md-12 text-center\">\r\n                        {{ Form::submit('Validate', ['class' => 'btn btn-primary']) }}\r\n                    </div>\r\n                </div>\r\n                {{ Form::close() }}\r\n            </div>\r\n        </div>\r\n    </div>\r\n@endsection\r\n```\r\nRequests\\ExampleRequest.php\r\n```PHP\r\nnamespace App\\Http\\Requests;\r\n\r\nuse Illuminate\\Foundation\\Http\\FormRequest;\r\n\r\nclass ExampleRequest extends FormRequest\r\n{\r\n    public function rules()\r\n    {\r\n        return [\r\n            'field_1' => 'required',\r\n            'field_2' => 'required',\r\n            'field_3' => 'required',\r\n            'field_4' => 'required',\r\n            'field_5' => 'required',\r\n            'field_6' => 'required',\r\n            'field_7' => 'required',\r\n            'field_8' => 'required',\r\n            'field_9' => 'required',\r\n            'field_10' => 'required',\r\n            'field_11' => 'required',\r\n            'field_12' => 'required',\r\n            'field_13' => 'required',\r\n            'field_14' => 'required',\r\n            'field_15' => 'required',\r\n            'field_16' => 'required',\r\n            'field_17' => 'required',\r\n            'field_18' => 'required',\r\n            'field_19' => 'required',\r\n            'field_20' => 'required',\r\n        ];\r\n    }\r\n}\r\n```\r\nValidationController@testValidation\r\n```PHP\r\nuse App\\Http\\Requests\\ExampleRequest;\r\npublic function testValidation(ExampleRequest $request)\r\n{\r\n    dd($request->all());\r\n}\r\n```\r\nIf I comment rules from field_16, validation works well.\r\n![Example](https://i.imgur.com/wUh9wJQ.png)\r\n\r\nIf I use the validator directly with a route closure, works well too:\r\n![Example](https://i.imgur.com/GELxnX2.png[/img)\r\n\r\nBut, with all the rules with the Custom Request and the controller, validation breaks and the page it´s reload without any error and the form empty without old inputs...\r\n\r\nAny help??\r\nThanks!"}}
{"actor":{"display_login":"Albvadi"}}