protected function validate_max($data, array $attributes = [])
{
// If no length defined, return empty string.
// @TODO Log the lack of a length...
if (empty($attributes)) {
return '';
}
$length = $attributes[0];
$data = trim($data);
if ($length >= strlen($data)) {
return $data;
}
return '';
}