noblemfd
1 month ago
127
2
Laravel

How to convert Form collection to HTML input field

Posted 1 month ago by noblemfd

I have this helper:

const LEAVE_APPLICABLE_GENDER = [
            1 => 'Both',
	2 => 'Male',
	3 => 'Female',
]; 

I made use of it in the view blade.

                                <div class="form-group has-feedback">
                                    <label for="leave_applicable_gender">Applicable Gender<span class="text-danger">*</span>
                                        <i class="fa fa-question-circle" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="select Applicable Gender"></i>
                                    </label>
                                    {!! Form::select('leave_applicable_gender', AppHelper::APPLICABLE_GENDER, $applicableGender , ['class' => 'form-control select2', 'required' => 'true']) !!}
                                    <span class="form-control-feedback"></span>
                                    <span class="text-danger">{{ $errors->first('leave_applicable_gender') }}</span>
                                </div>

How do I convert the Form Collection in the view blade to HTML Input field for select dropdown and also make "Both" that is 1 as the default?

Thanks

Please sign in or create an account to participate in this conversation.