kristijanhusak/laravel-form-builder

add new class name to choice type is not working properly

Open

#606 opened on Jul 10, 2020

 (1 comment) (0 reactions) (0 assignees)PHP (305 forks)github user discovery
help wanted

Repository metrics

Stars
 (1,715 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I want to add a new class required to input filed but it was not working as expected, there is no required class is added to input field.

->add('del_flg', Field::CHOICE, [
                'label' => '削除状態',
                'choices' => ['0' => '有効', '1' => '削除済'],
                'expanded' => true,
                'multiple' => false,
                'attr' => ['class' => 'required'],
                'choice_options' => [
                    'wrapper' => ['class' => 'choice-wrapper'],
                    'label_attr' => ['class' => 'required label-class'],
                ],
            ]) 

Contributor guide