public function required_with($str = null, ?string
$fields = null, array
$data =
[]): bool
{ if ($fields === null ||
empty($data)) { throw new InvalidArgumentException('You must supply the parameters: fields, data.'
);
} // If the field is present we can safely assume that
// the field is here, no matter whether the corresponding
// search field is present or not.
$present =
$this->
required($str ?? ''
);
if ($present) { return true;
} // Still here? Then we fail this test if
// any of the fields are present in $data
// as $fields is the list
$requiredFields =
[];
foreach (explode(',',
$fields) as $field) {