1
배열 내에 배열이있어 그것에 뭔가를 추가하고 싶습니다.Laravel 여러 레코드 저장
$options = $request->options;
foreach ($options as $option) {
$option['poll_id'] = $this->id;
}
dd($options);
하지만 어떤 이유로 배열에 추가되지 않습니다.
그래서 나는이 나타납니다
array:1 [
0 => array:1 [
"name" => "testtest"
]
]
을하지만이 기대 :
이array:1 [
0 => array:1 [
"name" => "testtest",
"poll_id" => 1
]
]