Added format parameter to Error->first method.
This commit is contained in:
parent
539eb28c2c
commit
89b5ad030e
|
@ -52,11 +52,12 @@ public function has($attribute)
|
|||
* Get the first error message for an attribute.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param string $format
|
||||
* @return string
|
||||
*/
|
||||
public function first($attribute)
|
||||
public function first($attribute, $format = ':message')
|
||||
{
|
||||
return (count($messages = $this->get($attribute)) > 0) ? $messages[0] : '';
|
||||
return (count($messages = $this->get($attribute, $format)) > 0) ? $messages[0] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue