/**
* A shortcut to performing validation on Request data.
*
* @param array|string $rules
* @param array $messages An array of custom error messages
*/
protected function validate($rules, array
$messages =
[]): bool
{ $this->
setValidator($rules,
$messages);
return $this->validator->
withRequest($this->request
)->
run();
} /**
* A shortcut to performing validation on any input data.
*
* @param array $data The data to validate
* @param array|string $rules
* @param array $messages An array of custom error messages
* @param string|null $dbGroup The database group to use
*/
protected function validateData(array
$data,
$rules, array
$messages =
[], ?string
$dbGroup = null
): bool
{