Fields

Toggle

Toggle is an on and off switch that holds a true or false value.

use Xelqun\Forms\Components\Toggle;

Toggle::make('is_featured')->default(true);

It works as a checkbox does, and takes the same description().

Toggle::make('is_visible')
    ->label('Visible to customers')
    ->description('Hidden products stay in reports.');

A model needs a boolean cast for this field.