Search code examples
htmllaravellaravelcollective

collective form convert html form


This is laravel collective form, This is a dropdown field, its connect with database. How can i convert normal html form???

 {!! Form::open(['method'=>'POST', 'action'=> xyz\AddController@store', 'id'=> 'form']) !!}

    <div class="form-group col-sm-5">
        {!! Form::label('student_id', 'Students:') !!}
        {!! Form::select('student_id', [''=>'Choose Options'] + $students , null, ['class'=>'form-control', 'id'=>'student', 'name'=>'student_id'])!!}
    </div>
    {!! Form::close() !!}

I want to convert format like this

<div class="form-group col-lg-5">
        <label for="qty">Traded Quantity</label>
        <input type="text" name="qty" id="qty" class="form-control" />
    </div>

Solution

  • If students list is coming through database then select tag can be like this,

    <select id="student" class="form_control" name="student_id">
     <option>Choose Options</option>
      @foreach($students as $student)
       <option value="{{$student->id}}">{{$student->id}}</option>
      @endforeach
    </select>