From 8784966b45f018d6880c809fa488b4a68d01d33b Mon Sep 17 00:00:00 2001 From: jerguslejko Date: Wed, 1 Mar 2017 21:33:37 +0100 Subject: [PATCH] Add any() method to ViewErrorBag --- src/Illuminate/Support/ViewErrorBag.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Support/ViewErrorBag.php b/src/Illuminate/Support/ViewErrorBag.php index 9bf776a0019b..ccc790d94f9b 100644 --- a/src/Illuminate/Support/ViewErrorBag.php +++ b/src/Illuminate/Support/ViewErrorBag.php @@ -70,6 +70,16 @@ public function count() return $this->getBag('default')->count(); } + /** + * Determine if the default message bag has any messages. + * + * @return bool + */ + public function any() + { + return $this->count() > 0; + } + /** * Dynamically call methods on the default bag. *