Merge pull request #633 from crynobone/feature/validator-replace-attr
Validator: During replace :attribute, need to verify Lang::has('key') instead of checking is_null()
This commit is contained in:
commit
1f706bd2d1
|
@ -946,17 +946,18 @@ protected function attribute($attribute)
|
||||||
// of the attribute name in the message.
|
// of the attribute name in the message.
|
||||||
$line = "{$bundle}validation.attributes.{$attribute}";
|
$line = "{$bundle}validation.attributes.{$attribute}";
|
||||||
|
|
||||||
$display = Lang::line($line)->get($this->language);
|
if (Lang::has($line, $this->language))
|
||||||
|
{
|
||||||
|
return Lang::line($line)->get($this->language);
|
||||||
|
}
|
||||||
|
|
||||||
// If no language line has been specified for the attribute, all of
|
// If no language line has been specified for the attribute, all of
|
||||||
// the underscores are removed from the attribute name and that
|
// the underscores are removed from the attribute name and that
|
||||||
// will be used as the attribtue name.
|
// will be used as the attribtue name.
|
||||||
if (is_null($display))
|
else
|
||||||
{
|
{
|
||||||
return str_replace('_', ' ', $attribute);
|
return str_replace('_', ' ', $attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $display;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue