xxxxxxxxxx
// In your controller or request class
public function rules()
{
return [
'password' => 'required',
'password_confirmation' => 'required|same:password'
];
}
xxxxxxxxxx
// password field like this
<input type="password" name="password"/>
// matching field like this
//{field}_confirmation
<input type="password" name="password_confirmation"/>
//validation rule
'password' => 'required|min:6|max:25|confirmed',
xxxxxxxxxx
'password' => 'required|confirmed',
reference : https://laravel.com/docs/4.2/validation#rule-confirmed
The field under validation must have a matching field of foo_confirmation.
For example, if the field under validation is password, a matching
password_confirmation field must be present in the input.
xxxxxxxxxx
'password' => 'required|
min:6|
regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\x])(?=.*[!$#%]).*$/|
confirmed',
xxxxxxxxxx
$this->validate($request, [
'name' => 'required|min:3|max:50',
'email' => 'email',
'vat_number' => 'max:13',
'password' => 'required|confirmed|min:6',
]);
xxxxxxxxxx
$this->validate($request, [
'name' => 'required|min:3|max:50',
'email' => 'email',
'vat_number' => 'max:13',
'password' => 'required|confirmed|min:6',
]);
xxxxxxxxxx
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rules\Password;
$validator = Validator::make($request->all(), [
'password' => ['required', 'confirmed', Password::min(8)],
]);