Я создал пользовательские переключатели, которые будут выбирать Присутствие раздел Да или Нет в зависимости от пользователя. Но когда я щелкаю по первому пользователю, следующий пользователь не может щелкнуть по разделу Присутствие .
Это вид

Это мой код просмотра
<table>
<thead>
<tr>
<th>No.</th>
<th>Name</th>
<th>
<center>Presence</center>
</th>
</tr>
</thead>
<tbody>
@php
$i=1;
@endphp
@foreach ($employee as $employee)
<tr>
<td>{{ $i }}</td>
<td>{{ $employee->name }}</td>
<td>
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<input type="radio" id="radio1" name="presence" value="Y" />
<label for="radio1">
<font color="#00B01D">
<i class="fas fa-check"/> Yes</font>
</label>
<input type="radio" id="radio2" name="presence" value="N" />
<label for="radio2">
<font color="#FF0000">
<i class="fas fa-times"/> No</font>
</label>
</td>
</tr>
@php
$i++;
@endphp
@endforeach
</tbody>
</table>
<script>
$(document).ready(function() {
$('input[type="radio"]').click(function(){
var presence = $(this).val();
$.ajax({
url:"{{ url('http://localhost/admin/presence/add') }}",
method:"POST",
data:{
presence:presence,
_token: $('input[name=_token]').val()
},
success:function(result){
}
});
});
});
</script>
и это моя функция контроллера
public function addprespost(Request $request)
{
$dataz = [
'presence' => $request->input('presence'),
];
DB::table('presence')->insert($dataz);
return redirect('/admin/presence/add');
}
Это таблица после успешной вставки данных
