torann/registry
Torann/Registry is a simple Laravel package for storing persistent key-value settings in the database with cache support. Use a clean registry API to get, set, and manage site-wide configuration values without extra boilerplate.
Build vs. buy for "app settings" — and the real answer is "don't build yet." Every product eventually needs runtime-editable configuration: support banners, maintenance mode copy, upload limits, default locale, onboarding text, pricing display rules. The default path is a bespoke settings table plus an admin screen, which is roughly a sprint of engineering plus permanent ownership of a small internal product. This package reframes the decision: adopt a thin key/value registry now (get/set/has/forget, dot-notation keys, defaults, in-memory caching, pluggable database/file/JSON drivers), wrap it in your own Settings interface in week one, and revisit in two quarters. The PM decision is not architectural — it's whether a defined class of changes should require a release, and this makes "no" the cheap answer.
Decoupling content and operational toggles from the deploy pipeline. Each key you move into the registry converts a pull request, code review, CI run, and deploy into an admin form edit. That's a direct lever on release cadence and time-to-change, and a measurable reduction in "can someone change this string for us?" interrupts — a real, budgetable product-ops cost line. Track it: number of config-change deploys per month before and after.
Lightweight feature-gating for early-stage roadmaps. For pre-PMF products, internal rollouts, and staged migrations, a registry key answers "do we gate this?" at near-zero cost. It supports sequencing decisions — ship dark, ramp by config, kill by config — without a vendor contract or a new dependency with its own learning curve.
Multi-tenant and white-label differentiation. Per-tenant namespaced keys (tenant.{id}.branding.name) enable brand names, feature availability, and plan-tier behavior. That's a packaging and pricing enabler when you need differentiated tiers before you have a billing-config service — but only if you standardize the prefix convention before tenants exist in the wild, since retrofitting is a data migration.
A deliberate probe that generates your platform requirements. Adopt this as a discovery instrument, not a permanent commitment. Real usage produces the requirements that tell you precisely when to graduate: audit trails (who turned off uploads at 3am), typed values, per-user targeting, percentage ramps, secret handling. Without usage you'll argue about those needs abstractly; with three months of usage you'll have a spec. The adoption itself is the research.
A forcing function for writing down your configuration contract. Committing to a config/settings.php allow-list — every legal key, its type, its default — gives you validation, an admin form autocomplete source, and orphan detection. That artifact is valuable regardless of which backend survives.
Adopt when most of these hold:
vendor:publish + migrate + one set + one get + a cache clear on your actual stack, and watch for PHP 8.2+ deprecation noise. Budget for the realistic outcome that you fork it into the repo — the surface is a provider, a facade, a driver, a migration, and an afternoon of reading.Settings interface with typed accessors (bool(), int(), array()) before the second call site exists, don't adopt. The facade leaking into twenty files is the failure mode that makes the eventual swap expensive.mysqldump, visible in any admin UI you build. Credentials stay in .env or a secrets manager — write that into the standard so nobody "helpfully" migrates one.Look elsewhere when:
spatie/laravel-settings or Laravel Pennant rather than building those on top of a package with no schema.To executives: We have a recurring class of change requests — banner copy, limits, defaults, tier behavior — that currently consume engineering releases to satisfy. This package converts them into an admin form edit. It's a small, contained dependency (a service provider, a facade, a driver, a migration) that one engineer can read end to end, and we'll wrap it behind our own interface so we are never locked in. The strategic value isn't the library; it's the information we get from actually running runtime configuration for a quarter, which tells us whether we need a real settings or flag platform and what it must do. Cost is days, not a sprint; downside is bounded because the whole thing is replaceable in one file.
To engineering: Three commands to a working store; auto-discovery means no config/app.php edits on 5.5+. Use the database driver plus a shared cache in production — the memory driver is test-only and the json driver silently diverges across containers, so neither belongs in prod. Three hard rules: never read the registry during boot (no service providers, no middleware constructors — a DB blip becomes an app-wide boot failure instead of one degraded feature); never import the facade outside App\Support\Settings; and seed every known key so a fresh environment is deterministic rather than silently falling through to whatever default each call site happened to pass. Add an audit log in the wrapper from day one — an hour of work that's the difference between "who changed this at 3am" being a five-minute answer or an incident review.
To the team owning it afterwards: We need a config/settings.php allow-list (key, type, default), a seeder, form-request validation on writes, typed accessors on every read, a quarterly orphan sweep, and a written rule that feature flags here are a staging area — anything surviving more than a release or two graduates to Pennant or gets deleted. Without that rule you have an unmanaged flag swamp within a quarter. Also on the standard: no secrets, ever.
The honest caveat to state up front: this package has no stars, no listed dependents, and no maintenance signal. We are adopting it with eyes open, pinning the version, spiking it on our stack first, and assuming we may fork or replace it. That's an acceptable trade for a bounded, wrapped, low-blast-radius capability — and it's why the wrapper is a condition of adoption, not a nice-to-have.
How can I help you explore Laravel packages today?