Make the key optional for has() too ... like a "has_any()" method
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
This commit is contained in:
parent
968808f8d6
commit
42edf70b10
|
@ -52,10 +52,18 @@ protected function unique($key, $message)
|
||||||
/**
|
/**
|
||||||
* Determine if messages exist for a given key.
|
* Determine if messages exist for a given key.
|
||||||
*
|
*
|
||||||
|
* <code>
|
||||||
|
* // Is there a message for the e-mail attribute
|
||||||
|
* return $messages->has('email');
|
||||||
|
*
|
||||||
|
* // Is there a message for the any attribute
|
||||||
|
* echo $messages->has();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function has($key)
|
public function has($key = null)
|
||||||
{
|
{
|
||||||
return $this->first($key) !== '';
|
return $this->first($key) !== '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue