1
I have the following form
My password fields are like this:
<div class="form-group {{ $errors->has('senha') ? ' has-error' : '' }}">
<label for="senha">Senha</label>
<input type="password" class="form-control" id="senha" name="senha" placeholder="Minino 8 dígitos" required value="{{ old('senha') }}">
@if ($errors->has('senha'))
<span class="help-block">
<strong>{{ $errors->first('senha') }}</strong>
</span>
@endif
</div>
<div class="form-group {{ $errors->has('senha1') ? ' has-error' : '' }}">
<label for="senha1">Repita a Senha</label>
<input type="password" class="form-control" id="senha1" name="senha1" placeholder="Minino 8 dígitos" required value="{{ old('senha1') }}">
@if ($errors->has('senha1'))
<span class="help-block">
<strong>{{ $errors->first('senha1') }}</strong>
</span>
@endif
</div>
I’m trying to validate like this using the confirmed
:
$senha = $request->get( 'senha' );
$senha1 = $request->get( 'senha1' );
$nivel = $request->get( 'nivel' );
$field = array(
'senha' => $senha,
'password_confirmation' => $senha1
);
$rules = array(
'senha' => 'required|confirmed|min:8',
);
$traducao = array(
'required' => 'Este campo é obrigatório',
'confirmed' => 'A confirmação de :attribute não confere.',
'min' => 'A tem que ter no mínimo 8 dígitos.',
);
$validator = Validator::make(
$field,
$rules,
$traducao
);
But it only comes back the way it is in the first picture
Thank you very much, it worked!
– adventistaam