HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/hasdeuac-119/has.deu.ac.kr/vendor/trin4ik/nova-switcher/README.md
# Laravel Nova Switcher Field
Replace default Boolean with switcher. \
Work on Index/Detail view with xhr, on Form like checkbox.

![](https://user-images.githubusercontent.com/839633/209843810-d656e6db-025f-4221-9c6c-9b238227706f.gif)

## Installation
```bash
composer require trin4ik/nova-switcher
```

## Usage
```php
use Trin4ik\NovaSwitcher\NovaSwitcher;
```
```php
NovaSwitcher::make('Active')
    ->trueLabel('On')
    ->falseLabel('Off');
```
or
```php
NovaSwitcher::make('Active')
    ->withLabels(true: 'On', false: 'Off');
```
Also, you can use reverse value (if switcher checked, value is false and vice versa)
```php
NovaSwitcher::make('Active')
    ->reverse();
```

## Thanks to...
- [David Piesse](https://github.com/davidpiesse), based on https://github.com/davidpiesse/nova-toggle
- [Thomas Lombart](https://dev.to/thomaslombart/how-to-build-a-reusable-and-accessible-toggle-switch-with-vue-3hh7) for the switcher css