@php $question_ids = []; $i = 0; function getOptions($id, $answers) { foreach ($answers as $answer) { if ($answer['id'] == $id) { return $answer['options']; } } return []; } @endphp