diff --git a/src/Illuminate/View/View.php b/src/Illuminate/View/View.php index 09cd8e1e3b83..6ca43c191d6b 100755 --- a/src/Illuminate/View/View.php +++ b/src/Illuminate/View/View.php @@ -2,6 +2,7 @@ namespace Illuminate\View; +use Closure; use Exception; use Throwable; use ArrayAccess; @@ -161,6 +162,8 @@ protected function gatherData() foreach ($data as $key => $value) { if ($value instanceof Renderable) { $data[$key] = $value->render(); + } elseif ($value instanceof Closure) { + $data[$key] = call_user_func($value); } }