how store Array of nested using livewire?
public $data=[
[
‘section_type’=>’’ ",
‘type’ =>’’ ",
]
];
how store Array of nested using livewire?
public $data=[
[
‘section_type’=>’’ ",
‘type’ =>’’ ",
]
];
You can use dot (.) or use forEach. It depends on your situation.
For example
public $data = ['abc', 'efg'];
for validation, you can use the following:
return [
'data.abc' => 'required ...'
];
To store the data:
SomeModel::create([
'abc' => $this->data['abc'],
]);
And so on …