{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/12607","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/12607/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12607/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/12607/events","html_url":"https://github.com/laravel/framework/issues/12607","id":138129274,"number":12607,"title":"Unique validation for array has a problem in updating.","user":{"login":"domesticlion","id":716659,"avatar_url":"https://avatars.githubusercontent.com/u/716659?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticlion","html_url":"https://github.com/domesticlion","followers_url":"https://api.github.com/users/domesticlion/followers","following_url":"https://api.github.com/users/domesticlion/following{/other_user}","gists_url":"https://api.github.com/users/domesticlion/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticlion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticlion/subscriptions","organizations_url":"https://api.github.com/users/domesticlion/orgs","repos_url":"https://api.github.com/users/domesticlion/repos","events_url":"https://api.github.com/users/domesticlion/events{/privacy}","received_events_url":"https://api.github.com/users/domesticlion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-03T09:45:33Z","updated_at":"2016-03-03T10:18:02Z","closed_at":null,"body":"According to the documentation, unique validations for array is defined like below.\r\n```\r\n$validator = Validator::make($request->all(), [\r\n    'person.*.email' => 'email|unique:users',\r\n    'person.*.first_name' => 'required_with:person.*.last_name',\r\n]);\r\n```\r\nBut this works well only in creating because each of the record conflicts with itself. Is there any way to specify each record's id to avoid conflict in updating?"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/191694155","html_url":"https://github.com/laravel/framework/issues/12607#issuecomment-191694155","issue_url":"https://api.github.com/repos/laravel/framework/issues/12607","id":191694155,"user":{"login":"ramilexe","id":1008882,"avatar_url":"https://avatars.githubusercontent.com/u/1008882?v=3","gravatar_id":"","url":"https://api.github.com/users/ramilexe","html_url":"https://github.com/ramilexe","followers_url":"https://api.github.com/users/ramilexe/followers","following_url":"https://api.github.com/users/ramilexe/following{/other_user}","gists_url":"https://api.github.com/users/ramilexe/gists{/gist_id}","starred_url":"https://api.github.com/users/ramilexe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramilexe/subscriptions","organizations_url":"https://api.github.com/users/ramilexe/orgs","repos_url":"https://api.github.com/users/ramilexe/repos","events_url":"https://api.github.com/users/ramilexe/events{/privacy}","received_events_url":"https://api.github.com/users/ramilexe/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T10:18:02Z","updated_at":"2016-03-03T10:18:02Z","body":"Create your custom request in Http/Requests\r\nIn `rules` method do like this:\r\n\r\n```\r\npublic function rules()\r\n{\r\n\r\n    switch ($this->method()) {\r\n        case 'GET':\r\n        case 'DELETE': {\r\n            return [];\r\n        }\r\n        case 'POST': {\r\n            return [\r\n                //some rules for create\r\n            ];\r\n        }\r\n        case 'PUT':\r\n        case 'PATCH': {\r\n            return [\r\n                //some rules for update\r\n            ];\r\n        }\r\n        default:\r\n            break;\r\n    }\r\n\r\n    return [];\r\n}\r\n```"}}