- 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.