{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/24520","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/24520/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/24520/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/24520/events","html_url":"https://github.com/laravel/framework/pull/24520","id":330752292,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjg0OTg3","number":24520,"title":"Retrieve the validated data of multidimensional input","user":{"login":"louisfisch","id":9432699,"node_id":"MDQ6VXNlcjk0MzI2OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/9432699?v=4","gravatar_id":"","url":"https://api.github.com/users/louisfisch","html_url":"https://github.com/louisfisch","followers_url":"https://api.github.com/users/louisfisch/followers","following_url":"https://api.github.com/users/louisfisch/following{/other_user}","gists_url":"https://api.github.com/users/louisfisch/gists{/gist_id}","starred_url":"https://api.github.com/users/louisfisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louisfisch/subscriptions","organizations_url":"https://api.github.com/users/louisfisch/orgs","repos_url":"https://api.github.com/users/louisfisch/repos","events_url":"https://api.github.com/users/louisfisch/events{/privacy}","received_events_url":"https://api.github.com/users/louisfisch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-08T18:04:46Z","updated_at":"2018-06-09T00:11:47Z","closed_at":"2018-06-09T00:11:47Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/24520","html_url":"https://github.com/laravel/framework/pull/24520","diff_url":"https://github.com/laravel/framework/pull/24520.diff","patch_url":"https://github.com/laravel/framework/pull/24520.patch"},"body":"I noticed that when using a form request and the `validated()` method to retrieve no more than the validated data, only the first level was filtered.\r\n\r\nI don't know if this was by choice or not. I work with a lot of multidimensional input data and It caused me more bad surprises than good ones. I am opening this pull request so the `validated()` method filters the validated data of multidimensional input.\r\n\r\nLet me give you an example:\r\n\r\n`UserRequest@rules` \r\n```\r\npublic function rules()\r\n{\r\n    return [\r\n        'address.city' => 'required|string',\r\n        'address.country' => 'required|string',\r\n        'password' => 'confirmed|required|string',\r\n        'username' => 'required|string'\r\n    ];\r\n}\r\n```\r\n\r\nInput data (JSON formatted)\r\n```\r\n{\r\n    \"address\": {\r\n        \"city\": \"Paris\",\r\n        \"country\": \"France\"\r\n        \"street_name\": \"Avenue des Champs-Élysées\"\r\n    },\r\n    \"email_address\": \"example@domain.com\"\r\n    \"foo\": \"bar\",\r\n    \"username\": \"louisfisch\",\r\n    \"password\": \"averysecretstring\"\r\n}\r\n```\r\n\r\nThe result of `$request->validated()`, `street_name` is still there:\r\n```\r\n[\r\n    'address' => [\r\n        'city' => 'Paris',\r\n        'country' => 'France',\r\n        'street_name' => 'Avenue des Champs-Élysées'\r\n    ],\r\n    'username' => 'louisfisch',\r\n    'password' => 'averysecretstring'\r\n]\r\n```\r\n\r\nWith this pull request:\r\n```\r\n[\r\n    'address\" => [\r\n        'city' => 'Paris',\r\n        'country' => 'France'\r\n    ],\r\n    'username' => 'louisfisch',\r\n    'password' => 'averysecretstring'\r\n]\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/395923374","html_url":"https://github.com/laravel/framework/pull/24520#issuecomment-395923374","issue_url":"https://api.github.com/repos/laravel/framework/issues/24520","id":395923374,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTkyMzM3NA==","user":{"login":"taylorotwell","id":463230,"node_id":"MDQ6VXNlcjQ2MzIzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/463230?v=4","gravatar_id":"","url":"https://api.github.com/users/taylorotwell","html_url":"https://github.com/taylorotwell","followers_url":"https://api.github.com/users/taylorotwell/followers","following_url":"https://api.github.com/users/taylorotwell/following{/other_user}","gists_url":"https://api.github.com/users/taylorotwell/gists{/gist_id}","starred_url":"https://api.github.com/users/taylorotwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taylorotwell/subscriptions","organizations_url":"https://api.github.com/users/taylorotwell/orgs","repos_url":"https://api.github.com/users/taylorotwell/repos","events_url":"https://api.github.com/users/taylorotwell/events{/privacy}","received_events_url":"https://api.github.com/users/taylorotwell/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T00:11:47Z","updated_at":"2018-06-09T00:11:47Z","author_association":"MEMBER","body":"I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework.\r\n\r\nFeel free to re-submit your change with a **thorough** explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc.\r\n\r\nThanks!"}}
{"actor":{"display_login":"taylorotwell"}}