This commit is contained in:
31
api/app/Rules/AtencaoBasica/Exportacao/CnsPaciente.php
Normal file
31
api/app/Rules/AtencaoBasica/Exportacao/CnsPaciente.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rules\AtencaoBasica\Exportacao;
|
||||
|
||||
use App\Rules\Cns;
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
class CnsPaciente implements Rule
|
||||
{
|
||||
/**
|
||||
* Determine if the validation rule passes.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
return Cns::isValid($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function message()
|
||||
{
|
||||
return 'CNS Inválido.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user