Added format parameter to Error->first method.

This commit is contained in:
Taylor Otwell 2011-07-21 11:00:19 -07:00
parent 539eb28c2c
commit 89b5ad030e
1 changed files with 3 additions and 2 deletions

View File

@ -52,11 +52,12 @@ public function has($attribute)
* Get the first error message for an attribute. * Get the first error message for an attribute.
* *
* @param string $attribute * @param string $attribute
* @param string $format
* @return string * @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] : '';
} }
/** /**