Somebody can help me, I do not load the data in the view of editing in laravel.
I'm making a query so you know which record to edit ..
I have seen that this is often done:
$asignacion=C_materia::find($id);
$id = $asignacion->idc_materia;
and I try to do it with this:
$idkalificacion = DB::table('k_calificaciones')
->join('k_alumnos', 'k_calificaciones.idk_alumno', '=', 'k_alumnos.idk_alumno')
->join('c_materias', 'k_calificaciones.idc_materia', '=', 'c_materias.idc_materia')
->select('k_calificaciones.*','k_calificaciones.id','k_calificaciones.primera_cal','k_calificaciones.segunda_cal','k_calificaciones.ps_cal','k_calificaciones.tercera_cal','k_calificaciones.prom_cal','k_calificaciones.fecha_curso','k_calificaciones.tipo_de_aprob')
->where('c_materias.idc_materia', '=', $id)->where('k_alumnos.idk_alumno','=', $id2)->get();
The variables $ id and $ id2 I receive them and with those I do the comparison
It does not mark me wrong, but it does not show me the data.
in the view I do this:
<td>
<div class="form-group{{ $errors->has('primera_cal') ? ' has-error' : '' }}">
<div class="col-xs-12">
<input id="primera_cal" type="input" class="form-control" name="primera_cal" value="{{$idkalificacion->primera_cal}}">
@if ($errors->has('primera_cal'))
<span class="help-block">
<strong>{{ $errors->first('primera_cal') }}</strong>
</span>
@endif
</div>
<br>
</div>
</td>
I pull them in a table the data .. I hope you can help me.