Skip to content

Instantly share code, notes, and snippets.

@Cyberiaaxis
Created November 14, 2017 12:34
Show Gist options
  • Save Cyberiaaxis/0e31731fe18135af0473d8e0793da3fa to your computer and use it in GitHub Desktop.
Save Cyberiaaxis/0e31731fe18135af0473d8e0793da3fa to your computer and use it in GitHub Desktop.
$data = [];
$now = Carbon::now();
foreach($request->option as $key => $value) {
$data[] = [
'question_id' => $ques->id,
'answer' => $value,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
QuestionsOption::insert($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment