Browse Source

Merge pull request #396 from cviebrock/develop

Make key optional for Messages->has() as well
Taylor Otwell 12 years ago
parent
commit
18f91414bb
1 changed files with 9 additions and 1 deletions
  1. 9 1
      laravel/messages.php

+ 9 - 1
laravel/messages.php

@@ -52,10 +52,18 @@ class Messages {
 	/**
 	 * 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
 	 * @return bool
 	 */
-	public function has($key)
+	public function has($key = null)
 	{
 		return $this->first($key) !== '';
 	}