- What is almirhodzic/nova-toggle-5 and how do I install it?
- It is a Laravel Nova 5 field that adds a clean, customizable toggle switch for boolean values, making on/off settings easier to manage in Nova admin panels. Installation is a standard Composer require followed by declaring the field on a Nova resource and adding the relevant columns to the toggleable-attribute whitelist. No additional infrastructure, queue, or storage dependency is implied.
- Which Laravel, Nova, and PHP versions does nova-toggle-5 support?
- The provided release notes do not list explicit Laravel, Nova, or PHP version constraints. It is a Laravel Nova 5 field, so it requires a Nova 5 installation. Confirm the exact Composer constraints resolve against your composer.lock before adding it to your dependency manifest.
- How do I customize the toggle labels and colors?
- The package is described as supporting configurable labels and colors for the toggle states. The README excerpt provided here is empty, so check the repository README for the exact fluent methods and options. The field is declared on a Nova resource like other Nova fields, so configuration stays on the Nova side.
- Why did the toggle return 404 for soft-deleted records?
- Before v1.3.1, the package-owned toggle endpoint returned 404 when the target row was soft-deleted, which made the control unusable from With Trashed lenses and similar views. The v1.3.1 fix conditionally applies withTrashed() to the lookup when the Nova resource uses soft deletes. Behavior is explicitly unchanged for resources without soft deletes.
- Does nova-toggle-5 work with With Trashed lenses and trashed rows?
- Yes, after v1.3.1 the toggle lookup includes trashed records when the Nova resource uses soft deletes, so the control works from With Trashed lenses. Authorization and whitelist checks are stated to still run against trashed records, so the fix does not open an authorization bypass. Teams should still confirm their Nova policies intentionally permit toggling trashed rows.
- How does authorization work with the toggle endpoint?
- The package depends on Nova routing, the Nova authorization layer, and field/attribute whitelisting to decide who can flip a flag and which columns are eligible. You must declare the field on the Nova resource and add the relevant columns to the toggleable-attribute whitelist. Both are standard Nova-side configuration rather than package work.
- Does toggling fire model events, observers, and audit logs?
- Because the toggle uses a package-owned HTTP endpoint rather than Nova's standard resource update flow, it introduces a second mutation path alongside Nova's resource controllers. Model events, observers, activity logs, and Nova action events must fire identically on both paths for the package to be a safe substitute. Verify this in your application before relying on it for audited flags.
- What test coverage exists for the soft-delete path in CI?
- The provided notes do not describe the package's test coverage or confirm whether the withTrashed() branch is covered in CI. Treat that as an open question for the maintainer and for your own integration tests. Smoke-test the toggle from a soft-delete-surfacing lens after upgrading.
- Is nova-toggle-5 safe and actively maintained for production?
- The v1.3.1 release has a small blast radius and is described as a drop-in Composer update with no configuration, migration, or resource-class changes. The residual risks are structural: a single maintainer, a small contributor base, and a mutation endpoint whose exact HTTP semantics such as verb, CSRF handling, and response shape are not documented in the notes. Add the route to your route and audit inventory and test it before production rollout.
- How do I upgrade from an earlier 1.x release to 1.3.1?
- Upgrading from any prior 1.x release is a patch-level, non-breaking change. Bump the constraint, run composer update almirhodzic/nova-toggle-5, clear config and route caches, and smoke-test the toggle from a soft-delete-surfacing lens. No data migration or asset and config republish is indicated.