Get id of a laravel combo

2

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?

Code:

<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}}">
        {{$materiasxma->mat_nombre}}</option>
        @endforeach
      </select>
      @if ($errors->has('idc_materia'))
      <span class="help-block">
        <strong>{{ $errors->first('idc_materia') }}</strong>
      </span>
      @endif
      <br/>
    </div>
    <a href="{{ route('k_calificacion.create', $materiasxma->idc_materia)}}"
       name="category"class="btn btn-info btn-md">Calificar grupo</a>
  </div>   
    
asked by Estefania 07.11.2017 в 07:07
source

1 answer

1

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>
  @endforeach
</select>
    
answered by 20.01.2018 в 13:42