<div class="form-group{{ $errors->has('field_name') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">Field Name</label>
<div class="col-md-6">
<select class="form-control" name="field_name">
<option value=""></option>
@foreach ($array_of_options as $key => $value)
<option value="{{ $key }}"
@if (old('field_name', $record->field_name) == $key)
selected="selected"
@endif
> {{ $value }}
</option>
@endforeach
</select>
@if ($errors->has('field_name'))
<span class="help-block">
<strong>{{ $errors->first('field_name') }}</strong>
</span>
@endif
</div>
</div>
• | Form Tag |
• | Query Builder: Get max value of a field |
• | Database: Using PDO |
• | Form Control: Input Text |