I've got an array within arrays and would like to add something to it.
$options = $request->options;
foreach ($options as $option) {
$option['poll_id'] = $this->id;
}
dd($options);
But for some reason it does not add to the array.
So I receive this:
array:1 [
0 => array:1 [
"name" => "testtest"
]
]
But I would expect this:
array:1 [
0 => array:1 [
"name" => "testtest",
"poll_id" => 1
]
]