Fra chatdiskussion fandt man ud af, at du vil opdatere flere scoringer, som er opført i tr, td. Du kan ændre det sådan her
Ændring i visningen
@foreach($scores as $score)
<tr>
<td>{{$score->lead->student_name}} <input type="hidden" name="scores[{{$loop->index}}][id]" value="{{$score->id}}"></td>
<td><input type="text" name="scores[{{$loop->index}}][jan_ap]" value="{{$score->jan_ap}}"></td>
<td><input type="text" name="scores[{{$loop->index}}][jan_hm]" value="{{$score->jan_hm}}"></td>
</tr>
@endforeach
Controlleropdateringsscore
public function update_score(Request $request)
{
$scores = $request->input('scores'); //here scores is the input array param
foreach($scores as $row){
$score = Score::find($row['id']);
$score->jan_ap = $row['jan_ap'];
$score->jan_hm = $row['jan_hm'];
$score->save();
}
}