PHPackages                             cznec/nova-switcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cznec/nova-switcher

ActiveLibrary

cznec/nova-switcher
===================

A Laravel Nova switcher field.

0191↓100%Vue

Since Feb 11Pushed 1y agoCompare

[ Source](https://github.com/cznec/nova-switcher)[ Packagist](https://packagist.org/packages/cznec/nova-switcher)[ RSS](/packages/cznec-nova-switcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

!!! Guys, I archived this project because I'm not using it anymore. If you want it, I can transfer my rights to you !!!

Laravel Nova Switcher Field
===========================

[](#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)](https://user-images.githubusercontent.com/839633/209843810-d656e6db-025f-4221-9c6c-9b238227706f.gif)

Installation
------------

[](#installation)

```
composer require trin4ik/nova-switcher
```

Usage
-----

[](#usage)

```
use Trin4ik\NovaSwitcher\NovaSwitcher;
...
NovaSwitcher::make('Active');
```

### Labels

[](#labels)

```
use Trin4ik\NovaSwitcher\NovaSwitcher;
...
NovaSwitcher::make('Active')
    ->trueLabel('On')
    ->falseLabel('Off');
...
NovaSwitcher::make('Active')
    ->withLabels(true: 'On', false: 'Off');
```

### Confirmation

[](#confirmation)

```
use Trin4ik\NovaSwitcher\NovaSwitcher;
...
NovaSwitcher::make('Active')
    ->confirmToTrue('enable?')
    ->confirmToFalse('disable?');
...
NovaSwitcher::make('Active')
    ->confirm(toTrue: 'enable?', toFalse: 'disable?');
```

of couse, you can only use confirmation dialogue to enable, or disable:

```
use Trin4ik\NovaSwitcher\NovaSwitcher;
...
NovaSwitcher::make('Active')
    ->confirmToFalse('Turn it off?');
```

### Reverse

[](#reverse)

Also, you can use reverse value (if switcher checked, value is false and vice versa)

```
NovaSwitcher::make('Active')
    ->reverse();
```

Thanks to...
------------

[](#thanks-to)

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

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50eb87772391dcd28ef3251661e7656d9963691c8997dce739f6b9f5b9f79255?d=identicon)[cznec](/maintainers/cznec)

---

Top Contributors

[![trin4ik](https://avatars.githubusercontent.com/u/839633?v=4)](https://github.com/trin4ik "trin4ik (10 commits)")

### Embed Badge

![Health badge](/badges/cznec-nova-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/cznec-nova-switcher/health.svg)](https://phpackages.com/packages/cznec-nova-switcher)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
