6 months ago

Laravel collective radio button breaks after specifying extra HTML attributes

Posted 6 months ago by mleontenko

I have the following radio buttons in my form:

<div class="form-check">                
    {{Form::radio('active', 'true', true, ['class' => 'form-check-input'])}}
    {{Form::label('active', 'Yes', ['class' => 'form-check-label'])}}
    {{Form::radio('active', 'false', ['class' => 'form-check-input'])}}
    {{Form::label('active', 'No', ['class' => 'form-check-label'])}}

I explicitly set the first option (Yes) to be checked, but in my application, the second one is checked (No). If I remove ['class' => 'form-check-input'] part, it checks the right one. What is wrong here?

I'm using laravel collective for the forms.

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