Questions tagged as 'validator'

2
answers

Validate file jpg - Laravel 5

I'm trying to use Validator to validate the upload file type but I do not know if the syntax is correct $data=Input::all(); $file = $data["picture_url"]; $rules = array('picture_url' => 'required|max:10000|mimes:jpg');...
asked by 12.02.2016 / 19:13
1
answer

How to validate at least one required field?

I have two fields CPF and CNPJ, the user must enter only one, but never leave both fields empty. This way it leaves the two fields mandatory: [ 'Cpf' => array('required'), 'Cnpj' => array('required'), ] Is there any way in Lar...
asked by 12.01.2017 / 14:14
0
answers

Validate CPF and CNPJ [closed]

Does anyone know of any CPF and CNPJ validator for Angular 2? I saw a package for Angle 1 as directives, is the implementation the same? package link     
asked by 21.12.2016 / 23:27
5
answers

Regular expression to find bar

I need to validate a field and it must have the following format: two_leths / numbers. Ex .: RN / 1234567. The two letters will always be uppercase and the number of numbers has no limit.     
asked by 12.07.2017 / 15:25
2
answers

Error installing larvel phplegends / en-br-validator

When I try to install the pt-br-validator via composer require laravellegends / en-br-validator or even editing the composer file manually I'm encountering the following error: [Symfony\Component\Debug\Exception\FatalThrowableError]...
asked by 24.04.2017 / 22:04
1
answer

Only uppercase and lowercase letters and accents in regular expressions [duplicate]

How to create a regular expression in the right way where it accepts only uppercase and lowercase letters, along with accents? This is to validate a string name, I created it as follows: $String = preg_replace("/([^a-zà-úA-ZÀ-Ú ])...
asked by 24.12.2017 / 07:10
1
answer

Validate password using Laravel

I have the following form Mypasswordfieldslooklikethis:<divclass="form-group {{ $errors->has('senha') ? ' has-error' : '' }}"> <label for="senha">Senha</label> <input type="password" class="form-control" id="se...
asked by 27.02.2018 / 16:20
2
answers

Validate checkbox fields with Bootstrap validator

I'm trying to use the Bootstrap validator in the checkbox fields, but I'm not sure how to do it. Is there a function in this library that does this or should I validate in pure JS? Code: <div class="form-check"> <div class="chec...
asked by 04.05.2018 / 13:52
0
answers

Additional method Jquery Validate ViaCep

Hello, I created an additional method with Jquery Validator to query the Brazilian ceps plus is returning false with valid ceps ... can anyone help me please. $.validator.addMethod('cep', function(val) { var cep = val.replace(/\D/g, '');...
asked by 17.08.2018 / 18:03
0
answers

How to do multiple validations Requests in Laravel?

Laravel allows you to create Requests to validate fields from the front end, but I wanted to do several Requests to validate a giant form. It's possible? Is it a good practice? I made Traits so that they could register for each one. This i...
asked by 04.05.2018 / 16:34