Skip to content

Commit a842af4

Browse files
committed
docs: improve description for required_with and required_without
1 parent 1ae4363 commit a842af4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,9 @@ permit_empty No Allows the field to receive an empty array,
818818
required No Fails if the field is an empty array, empty
819819
string, null or false.
820820
required_with Yes The field is required when any of the other ``required_with[field1,field2]``
821-
required fields are present in the data.
822-
required_without Yes The field is required when any of other ``required_without[field1,field2]``
823-
fields do not pass ``required`` checks.
821+
fields is not `empty()`_ in the data.
822+
required_without Yes The field is required when any of the other ``required_without[field1,field2]``
823+
fields is `empty()`_ in the data.
824824
string No A generic alternative to the alpha* rules
825825
that confirms the element is a string
826826
timezone No Fails if field does match a timezone per
@@ -880,6 +880,7 @@ valid_cc_number Yes Verifies that the credit card number matches
880880

881881
.. _timezone_identifiers_list(): https://www.php.net/manual/en/function.timezone-identifiers-list.php
882882
.. _strtotime(): https://www.php.net/manual/en/function.strtotime.php
883+
.. _empty(): https://www.php.net/manual/en/function.empty.php
883884

884885
.. _rules-for-file-uploads:
885886

0 commit comments

Comments
 (0)