Merge pull request #396 from cviebrock/develop

Make key optional for Messages->has() as well
This commit is contained in:
Taylor Otwell
2012-03-08 11:16:39 -08:00

View File

@@ -52,10 +52,18 @@ class Messages {
/** /**
* 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) !== '';
} }