1 | <?php |
||
11 | class Validator extends BaseValidator |
||
12 | { |
||
13 | /** |
||
14 | * Validation types |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | private $types = [ |
||
19 | 'final_customer' => 'validateFinalConsumer', |
||
20 | 'personal_identification' => 'validatePersonalIdentification', |
||
21 | 'natural_ruc' => 'validateNaturalRuc', |
||
22 | 'public_ruc' => 'validatePublicRuc', |
||
23 | 'private_ruc' => 'validatePrivateRuc', |
||
24 | 'ruc' => 'validateRuc', |
||
25 | 'is_natural_person' => 'validateIsNaturalPersons', |
||
26 | 'is_juridical_person' => 'validateIsJuridicalPersons', |
||
27 | 'all_identifications' => 'validateAllTypeIdentification', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Validate that the Ecuadorian identification is valid |
||
32 | * |
||
33 | * @param $attribute |
||
34 | * @param $value |
||
35 | * @param $parameters |
||
36 | * @return bool |
||
37 | * @throws \Exception |
||
38 | */ |
||
39 | public function validateEcuador($attribute, $value, $parameters) |
||
53 | |||
54 | /** |
||
55 | * Get the translated message or the default message. |
||
56 | * |
||
57 | * @param $attribute |
||
58 | * @param $rule |
||
59 | * @return mixed|string |
||
60 | */ |
||
61 | protected function getMessageEcuador($attribute, $rule) |
||
69 | |||
70 | /** |
||
71 | * Get the translated attribute or the default attribute. |
||
72 | * |
||
73 | * @param $attribute |
||
74 | * @return mixed |
||
75 | */ |
||
76 | protected function getAttributeEcuador($attribute) |
||
84 | |||
85 | /** |
||
86 | * Determine if the data passes the validation rules. |
||
87 | * |
||
88 | * @param $parameters |
||
89 | * @param $value |
||
90 | * @return bool |
||
91 | */ |
||
92 | protected function passesEcuador($parameters, $value) |
||
98 | } |
||
99 |