Open
Description
Here is my form:
{!! Form::open()->route('posts.update', [$post->id])->fill($post)->patch() !!}
{!! Form::text('title', 'Title')->attrs(['maxlength' => '255'])->required() !!}
{!! Form::textarea('body', 'Body')->attrs(['class' => 'wysiwyg'])->required() !!}
<input type="hidden" name="allow_comments" value="0">
{!! Form::checkbox('allow_comments', 'Allow comments?', '1')->wrapperAttrs(['class' => 'wrapper-allow_comments']) !!}
{!! Form::submit('Update Post') !!}
{!! Form::close() !!}
The allow_comments
field is a boolean field, as you can see in the migration file:
$table->boolean('allow_comments');
When I go to edit a post that has its allow_comments
field set to 1
, the checkbox renders as unchecked. I would expect it to render as checked.