当我想使用数据属性在laravel集合中的select选项中添加额外属性时遇到问题。
我的数据:
array:8 [
"id" => 3
"fee_head_title" => "ADMISSION FEE"
"fee_head_amount" => 5000
]
我想用laravel集体选择显示如下:
<select>
<option value="{{$array->id}}" data-amount="{{$array->fee_head_amount}}">
{{$array->title}}</option>
</select>
laravel集体选择模板:
{!! Form::select('fee_head[]', $fee_heads, null, ['class' => 'form-control', 'required']) !!}