Skip to content

fill() isn't populating checkboxes #75

Open
@ataylor32

Description

@ataylor32

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions