Files
rkm-conectasus-ci-sandbox/api/app/Http/Requests/Autenticacao/RecuperacaoSenhaRequest.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

44 lines
816 B
PHP

<?php
namespace App\Http\Requests\Autenticacao;
use App\Http\Requests\FormRequest;
use App\Rules\Cpf;
class RecuperacaoSenhaRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
switch($this->method()) {
case 'POST':
return $this->getPostRules();
break;
default:
return [];
}
}
private function getPostRules()
{
return [
'email' => [
'required',
'string',
'between:5,180',
'regex:/(.+)@(.+)\.(.+)/i',
],
'cpf' => [
'required',
'digits:11',
new Cpf,
],
];
}
}