Skip to content

Checkbox

tanthammar edited this page Sep 25, 2020 · 6 revisions

Extends BaseField

Checkbox

placeholder(string $placeholder)

The placeholder attribute becomes the checkbox label

Example:

Checkbox::make('Checkbox') //cast to boolean on model
    ->placeholder('The checkbox label')
    ->rules('boolean')
    ->default(1); //equivalent to checked

Blade component

<x-tall-checkbox
    :field="$field"
    :temp-key="$temp_key"
/>

Extend Blade component or override

Tanthammar\TallForms\Components\Checkbox::class
Clone this wiki locally