daniel-de-wit/nova-single-record-resource
Laravel Nova package that turns a resource into a single-record resource, so you can build singleton pages like settings, profiles, or site options. It hides index and create views and links directly to one editable record.
Architecture fit. The package is a purpose-built Nova extension that collapses the standard Nova index→detail navigation into a direct link for singleton resources (settings pages, site-wide config, "about" content, single-tenant profile records). It fits cleanly into the Nova resource lifecycle because it operates at the navigation/URI layer rather than the data layer — it likely overrides resource navigation URI generation (or decorates Nova::resources()) so the sidebar entry resolves to the sole record's detail route instead of /resources/{uriKey}. That is a thin, low-surface change, which is good for architecture fit: it does not require altering models, policies, or Nova's routing internals, and it can be scoped to only the resources that are genuinely singletons. The main architectural caveat is that it introduces an implicit invariant — "this resource has exactly one record" — that is not enforced by the database or Nova itself. If that invariant is ever violated, the abstraction silently degrades.
Integration feasibility. Integration is low-effort and idiomatic: Composer install, register the package in the Nova service provider (or via package discovery), and apply the provided trait/base class to the target Nova resource. There is no migration, no schema change, and no frontend build step. The effort is measured in hours, not days, and can be validated in a single staging environment. Composer constraint compatibility with the host app's laravel/nova version is the gating factor.
Technical risk. This is the dominant concern. The last release was February 2021 and the project has 18 stars, which places it firmly in the "abandoned micro-package" category. Nova's internals changed materially between Nova 3 (2021-era) and Nova 4/5 (Inertia/Vue 3 rewrite, route and navigation changes), so there is a high likelihood the package does not install or behave correctly on a current Nova installation. Secondary risks: no evident test suite or CI; no security policy or maintainer responsiveness; potential edge-case behavior when the singleton record does not yet exist (link should redirect to create, not 404); ambiguity if more than one record exists; and authorization drift if the nav link is visible to users who can viewAny but not view the record.
Key questions.
composer.json allow, and does it install cleanly against our pinned Nova version?view, viewAny) per-user?Stack fit. Laravel + Nova, PHP 7.x/8.x era. The package's concern is presentation-layer routing only, so it slots into the existing app/Nova resource definitions without touching domain code. It is compatible by design with Nova's resource registration model.
Migration path. Two viable paths. (1) Adopt the package as-is if it installs against our Nova version — fastest, lowest effort. (2) Vendor it: copy the small trait/class into app/Nova/Concerns/ under our namespace and drop the dependency. Given the abandonment risk, path 2 is the more defensible default: the package is small enough that internalizing it removes an external supply-chain and upgrade-blocking dependency at negligible cost. Treat the upstream repo as a reference implementation rather than a runtime dependency.
Compatibility. Verify against the exact laravel/nova constraint in composer.lock before committing. If we are on Nova 3, adoption is plausible; on Nova 4/5, expect to reimplement the navigation override against current APIs. Also confirm PHP version support and that no transitive dependencies are pinned to EOL versions. Pin the package to an exact version if adopted, and add it to the dependency-review list.
Sequencing.
Maintenance. Low ongoing code maintenance if vendored (a few dozen lines), but high "attention" cost if taken as an external dependency: no upstream fixes, no Nova-version tracking, and a future Nova upgrade will surface it as a blocker. Owning the code internally converts an upgrade hazard into a routine one-hour port.
Support. Community-only. No SLA, no maintainer guarantee, no documented issue triage. Internal ownership of the vendored copy is the only reliable support model, and it should be assigned to whichever team owns the Nova admin surface.
Scaling. The feature itself does not scale with traffic in any meaningful way — it is an admin-panel navigation concern. The one scaling-relevant detail is query behavior: resolving "the only record" during sidebar render, multiplied across many singleton resources, can add per-request queries to every admin page load. If the package resolves the record eagerly for each singleton resource, cache the record identifier or memoize per request. Admin concurrency is low, so this is a latency-polish concern, not a capacity one.
Failure modes.
view on the record, producing a 403 from the sidebar.Ramp-up. Very low. A Laravel/Nova-fluent engineer will understand the mechanism in under an hour and can reimplement it in half a day. The real ramp-up cost is institutional, not technical: the team must learn and honor the "exactly one record" invariant, which should be documented on each resource and, ideally, backed by a seed/fixture and a test.
Recommendation. Do not adopt as an unqualified runtime dependency given the 2021 last release, 18 stars, and Nova-version risk. Use it as a reference implementation, vendor the small amount of logic into app/Nova/Concerns, add tests for the zero/one/many-record and authorization cases, and apply it only to genuine singleton resources. The value is real and the implementation cost is trivial; the risk is entirely in depending on an unmaintained package rather than in the idea itself.
How can I help you explore Laravel packages today?