From 7134356108eb8bbe003ef7f71bfff8d1b01356cd Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Wed, 25 Aug 2021 22:46:48 +0100 Subject: [PATCH] Fix Blade component falsy slots (#38546) * fix * fix tests --- src/Illuminate/View/Concerns/ManagesComponents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/View/Concerns/ManagesComponents.php b/src/Illuminate/View/Concerns/ManagesComponents.php index 9febac86b0c3..5e8bf68ce6e8 100644 --- a/src/Illuminate/View/Concerns/ManagesComponents.php +++ b/src/Illuminate/View/Concerns/ManagesComponents.php @@ -125,7 +125,7 @@ protected function componentData() */ public function slot($name, $content = null, $attributes = []) { - if ($content) { + if (func_num_args() === 2 || $content !== null) { $this->slots[$this->currentComponent()][$name] = $content; } elseif (ob_start()) { $this->slots[$this->currentComponent()][$name] = '';