0
我試圖追加一個字符串到Laravel選擇菜單的選項值。如何將字符串追加到Laravel 5.1選擇菜單選項值
控制器:
$anytimeMinutesList = Models\Tariff::has('deals')->where('anytime_minutes', '>', '0')
->groupBy('anytime_minutes')->orderBy('anytime_minutes', 'asc')
->lists('anytime_minutes', 'anytime_minutes');
$anytimeMinutesList->prepend('No minutes', '0');
$anytimeMinutesList->prepend('Any minutes', '');
查看:
{!! Form::select('anytime_minutes', $anytimeMinutesList, Input::get('anytime_minutes'),
['class' => 'form-control']) !!}
請檢查Result
我希望能夠在字符串 '分鐘' 添加到每個選擇的菜單的選項值,以便它們讀取:
- 200分鐘
- 250分鐘
- 300分鐘
等等