Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
T

Toggle Switch Field

Readme

Toggle Switch Field for Nova 4

For Toggle Switch Field for Nova 3 go to https://github.com/naifalshaye/toggle-switch

Features:

  • Set custom color using hex color code.
  • Toggle in Index and details to update value instead of icons. Default (true).
  • Allow multiple toggles in same resource.
  • Allow Disabled toggle (readonly) with Gray color.

Requirements

  • PHP 8.0 or higher
  • Nova 4

Installation

You can install the package into a Laravel app that uses Nova via composer:

composer require naif/toggle-switch-field

Usage

Table column migration

$table->boolean('toggle')->default(true);

* Add toggle fields to $fillable in Model

Add the field to Nova Resource

  public function fields(NovaRequest $request)
    {
        return [
           ToggleSwitchField::make('Toggle','toggle')
                ->color('#3AB95A')
                ->indexToggle(false)
                ->detailToggle(false),
        ];
    }

Screenshots

Custom hex color code






Support:

naif@naif.io

https://naif.io

Bug Tracker:

https://github.com/naifalshaye/toggle-switch-field/issues

License

The MIT License (MIT). Please see License File for more information.

Reviews

By Almir Hodzic on November 10, 2025

Does not work on Nova 5.4! ->filterable() not possible

By denisvasilievclarity on February 28, 2024

Doesn't work at all

By ekazda on January 22, 2024

You will need to include "use Naif\ToggleSwitchField\ToggleSwitchField;" at the top of your file. Author should add this to their documentation. Additionally I could not get this field to recognize boolean fields. I've submitted an issue to the author and I'll update this review if the problem is ever resolved.

Back to Top
Added 2 years ago
Last updated 1 Year Ago
Version 2.0.0
Nova Version ~4.0|~5.0
Composer
naif/toggle-switch-field
GitHub stars 6
Packagist downloads 55,158

Favorites

2 users favorited

Rating

2.00
(out of 5)
★★★★★
★★★★
★★★
★★
3 ratings

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas