1. Go to this page and download the library: Download yuri-oliveira/validate 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/ */
return [
'> 'O campo :attribute deve conter um email válido.',
'max' => [
'string' => 'O campo :attribute deve conter no máximo :max caracteres.',
'file' => 'O arquivo :attribute deve ter o tamanho máximo de :max.'
]
];
use YuriOliveira\Validate\Message\Message;
ribute é customizado'
];
Message::extend($customMessages);
Message::get('O campo email é obrigatório.
Message::get('max.string', 'password', 25);
// resultado: O campo password deve conter no máximo 25 caracteres.