From f726f81449db0fd150cf017b3375b91e94bda1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pein=C3=B3?= Date: Tue, 10 Oct 2017 13:03:56 -0300 Subject: [PATCH 1/2] Implement __toString on 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 89e6a0527eca..8c06d6d4958f 100644 --- a/src/Illuminate/Support/ViewErrorBag.php +++ b/src/Illuminate/Support/ViewErrorBag.php @@ -117,4 +117,14 @@ public function __set($key, $value) { $this->put($key, $value); } + + /** + * Convert the default bag to its string representation. + * + * @return string + */ + public function __toString() + { + return (string) $this->getBag('default'); + } } From 4043672b9d1de78df9cce3bbe5476b94293c9049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pein=C3=B3?= Date: Tue, 10 Oct 2017 13:15:34 -0300 Subject: [PATCH 2/2] (style fix) --- src/Illuminate/Support/ViewErrorBag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/ViewErrorBag.php b/src/Illuminate/Support/ViewErrorBag.php index 8c06d6d4958f..0f273b5b7573 100644 --- a/src/Illuminate/Support/ViewErrorBag.php +++ b/src/Illuminate/Support/ViewErrorBag.php @@ -117,7 +117,7 @@ public function __set($key, $value) { $this->put($key, $value); } - + /** * Convert the default bag to its string representation. *