PHP code example of paulofelipem / laravel-brazilian-validators
1. Go to this page and download the library: Download paulofelipem/laravel-brazilian-validators library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
paulofelipem / laravel-brazilian-validators example snippets
$validatedData = $request->validate([
'campo.pix' => 'x' => '> 'uired|cnpj',
'campo.cpf' => 'equired|titulo_eleitor',
'campo.renavam' => ' => '
Validator::make($valor, $rules, ['celular_com_ddd' => 'O campo :attribute não é um celular'])
public function messages() {
return [
'campo.phone' => 'Celular não é válido!'
];
}
bash
'providers' => [
// ...
PauloFelipeM\BrazilianValidator\BrazilianValidatorServiceProvider::class,
];