naifalshaye / toggle-switch-field

5 stars 4 forks source link

Toggle Switch Field for Nova 4

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

Features:

Requirements

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.