Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Nova Toggle

Nova Toggle Laravel Package

davidpiesse/nova-toggle

Add a boolean toggle switch field to Laravel Nova resources with davidpiesse/nova-toggle. Display on/off states as a compact, interactive switch in forms and index views, perfect for flags, active status, and simple true/false settings.

View on GitHub
Deep Wiki
Context7

Nova Toggle is a lightweight Laravel Nova field that replaces plain boolean checkboxes with a clear, interactive toggle switch. It integrates directly into Nova resources, making on/off attributes easier to scan and edit while keeping forms and detail views clean and consistent.

  • Drop-in Toggle::make('Active') field for boolean columns
  • Clean, user-friendly switch UI in Nova forms and detail views
  • Seamless integration with existing Nova resources
  • Simple Composer installation and minimal configuration
Frequently asked questions about Nova Toggle
What does davidpiesse/nova-toggle do?
It is a lightweight Laravel Nova field that swaps a plain boolean checkbox for an interactive toggle switch. You use it as a drop-in replacement for Boolean::make() inside your Nova resources. It is presentation-only: one PHP field class extending Nova's Boolean field plus a compiled Vue component registered through Nova's asset pipeline. It adds no migrations, services, queues, or external calls.
How do I install davidpiesse/nova-toggle?
Install it with Composer using composer require davidpiesse/nova-toggle. There is no migration and no schema change, since the underlying column stays boolean or tinyint(1). Before rolling it out widely, check whether the package ships a prebuilt dist/ bundle or expects you to publish assets, and confirm that bundle targets the Vue version your Nova release uses.
Which Laravel Nova versions does nova-toggle support?
The last release was July 2022, which places the package in the Nova 4 and Vue 2 era, so Nova 5's Vue 3 and Vite pipeline is the likely failure point. Inspect the package's composer.json for an explicit laravel/nova constraint before assuming support. If the constraint is missing or wildcarded, treat it as 'pin and pilot' rather than 'adopt'. Verify against your installed Nova major before changing any resources.
How do I replace Boolean::make() with Toggle::make() in my Nova resources?
Change the import from Laravel\Nova\Fields\Boolean to Davidpiesse\NovaToggle\Toggle and swap Boolean::make('Active') for Toggle::make('Active'). Do it resource by resource under normal PR review rather than all at once. Keep a written inventory of which fields are now toggles, since that list becomes your QA checklist on every future Nova upgrade.
Does nova-toggle work with Nova 5 and Vue 3?
That is unproven and is the main compatibility risk. A Vue 2 bundle mounted into a Vue 3 Nova 5 install typically renders an empty field with a 200 response and clean logs, so nothing fails server-side. Check whether a prebuilt dist/ exists and which Vue major it targets. Because automated tests will not catch a silent render failure, confirm the field visually in a staging Nova 5 environment first.
Does nova-toggle change my database schema or how data is stored?
No. The field is presentation-layer only and writes nothing to the schema; the column remains boolean or tinyint(1). Rollback is simply reverting the import and the make() call. Because there is no data remediation involved, the real cost of adoption sits in verification and the ongoing Nova-upgrade obligation, not in infrastructure.
Is davidpiesse/nova-toggle still maintained?
Assume it is unmaintained on day one: one maintainer, no release since July 2022, zero dependents, and community-only support. Nova's paid support does not cover third-party fields, so no one upstream will fix a break for you. The mitigating factor is size, since the package is roughly a hundred lines across one PHP class, one Vue component, and one asset, so forking is hours rather than weeks. Decide in advance who owns that fork.
Does the toggle keep default(), rules(), nullable() and inline index editing behaviour?
It should, if src/Toggle.php genuinely extends Nova's core Boolean field and inherits default(), rules(), nullable(), fillUsing(), onlyOnForms() and exceptOnForms(). Read the class to confirm it extends Boolean rather than reimplementing those methods, because a reimplementation will silently diverge from core field semantics. Then verify all surfaces, including inline index editing, on a pilot resource. If you do not actually use inline index editing, the marginal benefit over a checkbox drops sharply.
How do I test that the nova-toggle field renders correctly?
Automated tests will not catch a Vue bundle that fails to mount, so add a visual QA step to your release checklist. Pilot one non-critical resource such as a settings page or taxonomy table, never users.is_active first, and check forms, detail views, index views, and inline index editing. Also watch for stale published assets under public/vendor/ that can shadow the vendor bundle and mask an upgrade, and for component-name collisions if other field packages register the same Vue component name.
What are the alternatives to nova-toggle?
The simplest alternative is Nova's built-in Boolean field, which is maintained by Nova's vendor and requires no third-party dependency. If you want a switch UI, you can ship a small custom Nova field of your own, or fork this package and maintain it internally, which is realistic given its size. Another option is a broader third-party Nova field collection that is actively released and declares a laravel/nova constraint. Pick based on how much you value a toggle-looking control versus a supported dependency.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console