View of the Question and Radio buttons
Php Laravel radiobutton selects only one radio button for all the given questions. How to I set up the for loop so I can select one radio button per question? I'm using eloquent ORM for setting up relationship between the tables.
<div class="card-header">{{$question->question_order}}{{"."}} {{ $question->question }}</div>
<div class="card-body">
<ul class="list-group">
@foreach($question->options as $option)
@if(($question->type)=='c')
<label class="container3">
<input type="checkbox" value="{{$option->option_id}}"> {{ $option->option }}
<span class="checkmark"></span>
</label>
@elseif(($question->type)=='r')
<label class="container3">
<input type="radio" name="radio" value="{{$option->option_id}}"> {{ $option->option }}
<span class="radio"></span>
</label>
@endif
@endforeach
@if(($question->type)=='s')
<textarea class="form-control" rows="5" id=""></textarea>
@endif
</ul>
</div>