I have the following view that shows all the students of a subject and its corresponding notes, how can I do to edit said fields?
This is my driver who receives the id of the subject as such and calls the students with their grades with the relationship.
public function agregarNota($id)
{
$asignatura = Asignatura::find($id);
$alumnos = Asignatura::find($id)->alumnos;
$calificaciones = Asignatura::find($id)->calificaciones;
return view('calificaciones.agregar')->with('alumnos',$alumnos)->with('asignatura',$asignatura)->with('calificaciones',$calificaciones);
}
I need help to edit those fields, I'm used to the normal CRUD that is by rows.
This is the view
<table class="table table-bordered table-responsive">
<tr>
<th width="120">Rut</th>
<th>N1</th>
<th>N2</th>
<th>N3</th>
<th>N4</th>
<th>N5</th>
<th>N6</th>
<th>N7</th>
<th>N8</th>
<th>Promedio</th>
<th>Examen</th>
<th>Final</th>
</tr>
@foreach ($calificaciones as $c)
<tr>
<td>{{$c->alumno->rut}}</td>
<td>{!! Form::text('n1', $c->n1, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n2', $c->n2, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n3', $c->n3, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n4', $c->n4, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n5', $c->n5, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n6', $c->n6, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n7', $c->n7, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('n8', $c->n8, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('promedio', $c->promedio, array('class' => 'form-control', 'readonly' => 'readonly')) !!}</td>
<td>{!! Form::text('examen', $c->examen, array('class' => 'form-control')) !!}</td>
<td>{!! Form::text('final', $c->final, array('class' => 'form-control', 'readonly' => 'readonly')) !!}</td>
</tr>
@endforeach
</table>