Skip to content

Commit

Permalink
Actualización en mensaje de validación que se muestra desde la regla
Browse files Browse the repository at this point in the history
  • Loading branch information
tony98ms committed Mar 24, 2024
1 parent 3935fe5 commit ceb1bba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Rules/ValidDocumentEc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class ValidDocumentEc implements Rule
private array $types = [
'ci' => 'validarCedula',
];
private $messages = [
'ci' => 'Cédula',
];
public function __construct(
private string $parameter,
) {
Expand Down Expand Up @@ -39,6 +42,6 @@ public function passes($attribute, $value)
*/
public function message()
{
return __('validation::validate.document_ec');
return str_replace(':type', $this->messages[$this->parameter], __('validation::validate.document_ec'));
}
}

0 comments on commit ceb1bba

Please sign in to comment.