Get id of a laravel combo


I'm working with LARAVEL I have a foreach that uploads stuff to me from my database in a view. I need to select a subject to send your id to another view ...

What he does now is that when selecting different subjects, he loads the same id, and that id is the last matter of the foreach.

Does anyone know how this is done?


<div class="form-group{{ $errors->has('idc_materia') ? ' has-error' : '' }}">
  <div class="col-sm-4">
    <select id="" class="form-control" name="">
      @foreach ($materiasxmaestro as $materiasxma)
      <option value="{{$materiasxma->idc_materia}}">
      @if ($errors->has('idc_materia'))
      <span class="help-block">
        <strong>{{ $errors->first('idc_materia') }}</strong>
    <a href="{{ route('k_calificacion.create', $materiasxma->idc_materia)}}"
       name="category"class="btn btn-info btn-md">Calificar grupo</a>
asked by Estefania 07.11.2017 в 07:07

1 answer


You were missing the name="matter"

<select id="" class="form-control" name="materia">
  @foreach ($materiasxmaestro as $materiasxma)
  <option value="{{$materiasxma->idc_materia}}">{{$materiasxma->mat_nombre}}</option>
answered by 20.01.2018 в 13:42