diff --git a/src/Illuminate/View/DynamicComponent.php b/src/Illuminate/View/DynamicComponent.php index b45715212bbe..793c34e05241 100644 --- a/src/Illuminate/View/DynamicComponent.php +++ b/src/Illuminate/View/DynamicComponent.php @@ -54,7 +54,7 @@ public function __construct(string $component) public function render() { $template = <<<'EOF' -getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace(':', ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?> +getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace([':', '.'], ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?> {{ props }} {{ slots }} @@ -113,7 +113,7 @@ protected function compileProps(array $bindings) protected function compileBindings(array $bindings) { return collect($bindings)->map(function ($key) { - return ':'.$key.'="$'.Str::camel(str_replace(':', ' ', $key)).'"'; + return ':'.$key.'="$'.Str::camel(str_replace([':', '.'], ' ', $key)).'"'; })->implode(' '); } diff --git a/tests/Integration/View/BladeTest.php b/tests/Integration/View/BladeTest.php index bba1416dc86c..5f4b3d10ab0b 100644 --- a/tests/Integration/View/BladeTest.php +++ b/tests/Integration/View/BladeTest.php @@ -30,7 +30,7 @@ public function test_rendering_a_dynamic_component() { $view = View::make('uses-panel-dynamically', ['name' => 'Taylor'])->render(); - $this->assertEquals('
+ $this->assertEquals('
Hello Taylor
', trim($view)); } diff --git a/tests/Integration/View/templates/uses-panel-dynamically.blade.php b/tests/Integration/View/templates/uses-panel-dynamically.blade.php index ab739a4ea06f..48cbc3e90192 100644 --- a/tests/Integration/View/templates/uses-panel-dynamically.blade.php +++ b/tests/Integration/View/templates/uses-panel-dynamically.blade.php @@ -1,3 +1,3 @@ - + Panel contents