I've got a dynamic component which I am trying to pass an array of data to like:
<x-dynamic-component
:component="$component['component']"
:data="$component"
/>
However when I try and access $data from within my component blade view. $data is not an array, its and instance of Illuminate\View\DynamicComponent:
Illuminate\View\DynamicComponent {#1564 ▼ // resources/views/components/page-builder/test-one.blade.php
#except: []
+componentName: "dynamic-component"
+attributes: Illuminate\View\ComponentAttributeBag {#1567 ▼
#attributes: array:1 [▼
"data" => Illuminate\View\DynamicComponent {#1564}
]
}
+component: "page-builder.test-one"
}
I've also tried:
<x-dynamic-component
:component="$component['component']"
data="{{$component}}"
/>
but then I recieve
htmlspecialchars(): Argument #1 ($string) must be of type string, Illuminate\View\DynamicComponent given.
Any help on how I can pass an array of data to the view and how to access it would be much appreciated.