diff --git a/src/Attributes/Validation/Ascii.php b/src/Attributes/Validation/Ascii.php new file mode 100644 index 00000000..87f76f91 --- /dev/null +++ b/src/Attributes/Validation/Ascii.php @@ -0,0 +1,19 @@ +min, $this->max]); + } +} diff --git a/src/Attributes/Validation/GreaterThanOrEqual.php b/src/Attributes/Validation/GreaterThanOrEqual.php new file mode 100644 index 00000000..9c9f2cc4 --- /dev/null +++ b/src/Attributes/Validation/GreaterThanOrEqual.php @@ -0,0 +1,29 @@ +field = $this->parseFieldReference($field); + } + + + public static function keyword(): string + { + return 'gte'; + } + + public function parameters(): array + { + return [$this->field]; + } +} diff --git a/src/Attributes/Validation/LessThanOrEqual.php b/src/Attributes/Validation/LessThanOrEqual.php new file mode 100644 index 00000000..67e42bad --- /dev/null +++ b/src/Attributes/Validation/LessThanOrEqual.php @@ -0,0 +1,29 @@ +field = $this->parseFieldReference($field); + } + + + public static function keyword(): string + { + return 'lte'; + } + + public function parameters(): array + { + return [$this->field]; + } +} diff --git a/src/Attributes/Validation/MimeTypeByFileExtension.php b/src/Attributes/Validation/MimeTypeByFileExtension.php new file mode 100644 index 00000000..0aab4412 --- /dev/null +++ b/src/Attributes/Validation/MimeTypeByFileExtension.php @@ -0,0 +1,25 @@ +types); + } +} diff --git a/src/Attributes/Validation/Missing.php b/src/Attributes/Validation/Missing.php new file mode 100644 index 00000000..efe87938 --- /dev/null +++ b/src/Attributes/Validation/Missing.php @@ -0,0 +1,19 @@ +field = $this->parseFieldReference($field); + $this->values = Arr::flatten($values); + } + + public static function keyword(): string + { + return 'missing_if'; + } + + public function parameters(): array + { + return [ + $this->field, + $this->values, + ]; + } +} diff --git a/src/Attributes/Validation/MissingUnless.php b/src/Attributes/Validation/MissingUnless.php new file mode 100644 index 00000000..1cb167ea --- /dev/null +++ b/src/Attributes/Validation/MissingUnless.php @@ -0,0 +1,40 @@ +field = $this->parseFieldReference($field); + $this->values = Arr::flatten($values); + } + + + public static function keyword(): string + { + return 'missing_unless'; + } + + public function parameters(): array + { + return [ + $this->field, + $this->values, + ]; + } +} diff --git a/src/Attributes/Validation/MissingWith.php b/src/Attributes/Validation/MissingWith.php new file mode 100644 index 00000000..383edb61 --- /dev/null +++ b/src/Attributes/Validation/MissingWith.php @@ -0,0 +1,33 @@ +fields[] = $field instanceof FieldReference ? $field : new FieldReference($field); + } + } + + public static function keyword(): string + { + return 'missing_with'; + } + + public function parameters(): array + { + return [ + $this->fields, + ]; + } +} diff --git a/src/Attributes/Validation/MissingWithAll.php b/src/Attributes/Validation/MissingWithAll.php new file mode 100644 index 00000000..65146eb8 --- /dev/null +++ b/src/Attributes/Validation/MissingWithAll.php @@ -0,0 +1,33 @@ +fields[] = $field instanceof FieldReference ? $field : new FieldReference($field); + } + } + + public static function keyword(): string + { + return 'missing_with_all'; + } + + public function parameters(): array + { + return [ + $this->fields, + ]; + } +} diff --git a/src/Attributes/Validation/Negative.php b/src/Attributes/Validation/Negative.php new file mode 100644 index 00000000..9dd02008 --- /dev/null +++ b/src/Attributes/Validation/Negative.php @@ -0,0 +1,19 @@ +field = $this->parseFieldReference($field); + $this->values = Arr::flatten($values); + } + + public static function keyword(): string + { + return 'present_if'; + } + + public function parameters(): array + { + return [ + $this->field, + $this->values, + ]; + } +} diff --git a/src/Attributes/Validation/PresentUnless.php b/src/Attributes/Validation/PresentUnless.php new file mode 100644 index 00000000..b2743ba9 --- /dev/null +++ b/src/Attributes/Validation/PresentUnless.php @@ -0,0 +1,40 @@ +field = $this->parseFieldReference($field); + $this->values = Arr::flatten($values); + } + + + public static function keyword(): string + { + return 'present_unless'; + } + + public function parameters(): array + { + return [ + $this->field, + $this->values, + ]; + } +} diff --git a/src/Attributes/Validation/PresentWith.php b/src/Attributes/Validation/PresentWith.php new file mode 100644 index 00000000..f269533a --- /dev/null +++ b/src/Attributes/Validation/PresentWith.php @@ -0,0 +1,33 @@ +fields[] = $field instanceof FieldReference ? $field : new FieldReference($field); + } + } + + public static function keyword(): string + { + return 'present_with'; + } + + public function parameters(): array + { + return [ + $this->fields, + ]; + } +} diff --git a/src/Attributes/Validation/PresentWithAll.php b/src/Attributes/Validation/PresentWithAll.php new file mode 100644 index 00000000..0fc3a5cd --- /dev/null +++ b/src/Attributes/Validation/PresentWithAll.php @@ -0,0 +1,33 @@ +fields[] = $field instanceof FieldReference ? $field : new FieldReference($field); + } + } + + public static function keyword(): string + { + return 'present_with_all'; + } + + public function parameters(): array + { + return [ + $this->fields, + ]; + } +}