我正在努力在 laravel Blade 的下拉列表中显示表中的货币列表。在下拉选项中,我想设置 csv 文件中设置的第一个值货币。但下拉记录来自表。
如何在上传的 csv 文件中设置下拉列表中的第一个值。
谢谢你的帮助。
以下是我的代码。
我的.blade.php
将来自 csv 的货币存储在variable = $array['currency']
<td class="currency"style="width: 10%;">
{{ Form::select('currency',$currencies , "",['class'=>"form-control select-currency",'data-plugin'=>"select2",
]) }}
</td>
MyModel.php
$currencies = Currency::all()->pluck('code', 'id');
$questions_table = \View::make('confirmation.form_questionnaire',
['questions' => $record['questions'], 'response_type' =>$record['response_type'], 'currencies' => $currencies]);