laravel-bap
Keymaster
    # 2 years, 6 months ago

    Hi,

    just add ‘multiple’ => true

    $this->add(‘roles’, ‘choice’, [
    ‘choices’ => $roles,
    ‘attr’ => [‘class’ => ‘select2 pmd-select2 form-control’],
    ‘selected’ => $this->model ? $this->model->roles()->pluck(‘name’)->toArray() : null ,
    ‘expanded’ => false,
    ‘multiple’ => true
    ]);


    remember that you will need to implement relation one to many or many to many.