【发布时间】:2017-05-05 11:02:06
【问题描述】:
在我的控制器中
$this->selectedUsers = UserTipepermintaanRelationship::where('permintaan_tipe_id', $id)->pluck('user_id', 'user_id');
上面的对象会给出输出:
1 => 1
2 => 2
25 => 25
在我的 html 中:
{!! Form::select('user_id[]', $users, isset($tipePermintaan) ? $selectedUsers : null, ['class' => 'form-control select-user', 'multiple']) !!}
我想用selectedUsers 设置我的select2 多个值。
但我无法在我的 select2 倍数上设置值。我哪里做错了?
【问题讨论】:
-
你使用的是 Laravel 4.* 还是 Laravel Collective?
-
能否提供完整代码?