protected function getAttribute($attribute)
{
// The developer may dynamically specify the array of custom attributes
// on this Validator instance. If the attribute exists in this array
// it takes precedence over all other ways we can pull attributes.
if (isset($this->customAttributes[$attribute])) {
return $this->customAttributes[$attribute];
}
$key = "validation.attributes.{$attribute}";
// We allow for the developer to specify language lines for each of the
// attributes allowing for more displayable counterparts of each of
// the attributes. This provides the ability for simple formats.
if (($line = $this->translator->trans($key)) !== $key) {
return $line;
} else {
return str_replace('_', ' ', snake_case($attribute));
}
}