{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/internals/issues/123","repository_url":"https://api.github.com/repos/laravel/internals","labels_url":"https://api.github.com/repos/laravel/internals/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/laravel/internals/issues/123/comments","events_url":"https://api.github.com/repos/laravel/internals/issues/123/events","html_url":"https://github.com/laravel/internals/issues/123","id":162322844,"number":123,"title":"[Proposal] a better implementation of the current password_confirm","user":{"login":"ctf0","id":7388088,"avatar_url":"https://avatars.githubusercontent.com/u/7388088?v=3","gravatar_id":"","url":"https://api.github.com/users/ctf0","html_url":"https://github.com/ctf0","followers_url":"https://api.github.com/users/ctf0/followers","following_url":"https://api.github.com/users/ctf0/following{/other_user}","gists_url":"https://api.github.com/users/ctf0/gists{/gist_id}","starred_url":"https://api.github.com/users/ctf0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctf0/subscriptions","organizations_url":"https://api.github.com/users/ctf0/orgs","repos_url":"https://api.github.com/users/ctf0/repos","events_url":"https://api.github.com/users/ctf0/events{/privacy}","received_events_url":"https://api.github.com/users/ctf0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-26T10:57:03Z","updated_at":"2016-06-26T10:57:03Z","closed_at":null,"body":"- the current implmentation not that great because when using confirmed means that any errors you get from the confirmed field will display at the parent input.\r\n\r\n1- controller\r\n```php\r\n$rules = [\r\n    'password'              => 'required|min:6',\r\n    'password_confirmation' => 'required_with:password|same:password',\r\n];\r\n```\r\n2- view\r\n```php\r\n<!-- password -->\r\n<fieldset class=\"form-group\">\r\n    {{ Form::label('password', 'password :') }}\r\n    {{ Form::password('password') }}\r\n    @if ($errors->has('password'))\r\n        <strong>{{ $errors->first('password') }}</strong>\r\n    @endif\r\n</fieldset>\r\n\r\n<!-- password_confirmation -->\r\n<fieldset class=\"form-group\">\r\n    {{ Form::label('password_confirmation', 'password_confirmation :') }}\r\n    {{ Form::password('password_confirmation') }}\r\n    @if ($errors->has('password_confirmation'))\r\n        <strong>{{ $errors->first('password_confirmation') }}</strong>\r\n    @endif\r\n</fieldset>\r\n\r\n```\r\n\r\nas u can see nothing changed except the validation rules.\r\n> u can also use the below to make the errors more user friendly ,add the below to ur langauge validation\r\n\r\n```php\r\n'custom' => [\r\n    'password_confirmation' => [\r\n        'required_with' => 'The password confirmation field is required.',\r\n        'same'          => 'The password confirmation and password must be of the same value.',\r\n    ],\r\n],\r\n```\r\n\r\nhttps://github.com/laravel/framework/issues/4510"}}
{"actor":{"display_login":"ctf0"}}