diff --git a/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php b/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php index 8f6c4ce8662a..2b1c0e8e41d4 100644 --- a/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php +++ b/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php @@ -338,6 +338,17 @@ protected function compileDisabled($condition) return ""; } + /** + * Compile a required block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileRequired($condition) + { + return ""; + } + /** * Compile a readonly block into valid PHP. * diff --git a/tests/View/Blade/BladeCheckedStatementsTest.php b/tests/View/Blade/BladeCheckedStatementsTest.php index f689fbea0048..dfac6b457664 100644 --- a/tests/View/Blade/BladeCheckedStatementsTest.php +++ b/tests/View/Blade/BladeCheckedStatementsTest.php @@ -27,4 +27,12 @@ public function testDisabledStatementsAreCompiled() $this->assertEquals($expected, $this->compiler->compileString($string)); } + + public function testRequiredStatementsAreCompiled() + { + $string = ''; + $expected = "/>"; + + $this->assertEquals($expected, $this->compiler->compileString($string)); + } }