Checkbox
Minimal
Checkbox::make('Checkbox') //cast to boolean on model?
->rules('boolean')
->default(true)
Detailed
Checkbox::make('Checkbox') //cast to boolean on model?
->xmodel(on: 'debounce.300ms', defer: false)
->placeholder('The checkbox label')
->attr(['data-hi' => 'hello'])
->rules('boolean')
->default(true); //equivalent to checked
Comments about some options
Options | Comment |
Alpine | This field is an Alpine component to prevent lagging on fast user input |
xmodel() | Entangle is deferred by default |
placeholder() | Becomes the checkbox label. Optional. |
default() | true = checked, false = unchecked |
//Livewire properties example
public array $checkbox = true;
<x-tall-checkbox :field="Checkbox::blade('checkbox')
->placeholder('The checkbox label')"/>
Search for Checkbox
in tall-theme.css
Last updated