how can i change my html form to laravel collective form
<select style="width:50%;margin-top: 10px;" name="idw">
<option value="0" disabled="true" selected="true">choose</option>
@foreach($warehouse as $w)
<option value="{{$w->id}}" name="idw" id="idw">{{$w->name}}</option>
@endforeach
</select>
in my collective form
{!! Form::select('type',
['Task' => $w->id =>w-> $name ],
null,
['class' => 'form-control chosen-type', 'placeholder' => 'Please Choose']
)!!}
i nvu use collective form before
In your form:
<div class="form-group">
{{ Form::label('Warehouses') }}
{{ Form::select('warehouse', $warehouseList, null, array('class'=>'form-control', 'placeholder'=>'Please select ...')) }}
</div>
In your controller:
$warehouseList = Warehouse::all()->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE)->pluck('name', 'id');