Skip to main content

Introduction

The checkbox component, similar to a toggle, allows you to interact a boolean value.
If you’re saving the boolean value using Eloquent, you should be sure to add a boolean cast to the model property:

Positioning the label above

Checkbox fields have two layout modes, inline and stacked. By default, they are inline. When the checkbox is inline, its label is adjacent to it:
When the checkbox is stacked, its label is above it:

Checkbox validation

As well as all rules listed on the validation page, there are additional rules that are specific to checkboxes.

Accepted validation

You may ensure that the checkbox is checked using the accepted() method:
Optionally, you may pass a boolean value to control if the validation rule should be applied or not:

Declined validation

You may ensure that the checkbox is not checked using the declined() method:
Optionally, you may pass a boolean value to control if the validation rule should be applied or not: