For Toggle Switch Field for Nova 3 go to https://github.com/naifalshaye/toggle-switch
- Set custom color using hex color code
- Toggle or Icon align. Default (left)
- Toggle Switch in Index to update value instead of icons. Default (true)
- Toggle Switch in Detail to update value instead of icons. Default (true)
- PHP 8.0 or higher
- Nova 4
You can install the package into a Laravel app that uses Nova via composer:
composer require naif/toggle-switch-field
Table column migration
$table->boolean('toggle')->nullable()->default(true);
Add the field to Nova Resource
public function fields(NovaRequest $request)
{
return [
ToggleSwitchField::make('Toggle','toggle')
->color('#3AB95A')
->toggleAlign('center')
->indexToggle(false)
->detailToggle(false),
];
}
Bug Tracker:
https://github.com/naifalshaye/toggle-switch-field/issues
The MIT License (MIT). Please see License File for more information.