stepanenko3/nova-settings
A Laravel Nova tool for managing application settings from your admin panel. Define settings in code, edit them in Nova, and read values through a simple helper, keeping configuration editable without redeploys or env file changes. Useful for site options and feature flags.
Architecture fit
config/nova-settings.php using native Nova field classes; the UI is Nova's own resource chrome; persistence is a read-mutate-rewrite of .env.APP_KEY, APP_ENV, DB_*, QUEUE_CONNECTION, LOG_CHANNEL), secrets, anything needing audit/versioning/rollback, or any environment where the .env file is not the deployment source of truth (Docker/K8s/env injection). Those are category mismatches, not configuration problems.Integration feasibility
composer require, vendor:publish, register the tool in NovaServiceProvider::tools(), author the config. An engineer can demo the loop in an afternoon.env() call outside config/*.php must become config(), or the tool's writes are invisible once config:cache runs. Budget this explicitly — it is the difference between a useful tool and a decorative one..env.example reconciliation in CI; backup-before-write; activity logging for author attribution; write permissions on .env for the FPM user.Nova::tools() authorization path vs the tool's own group/field gates should be checked in src/ before we commit.Technical risk
.env, correct in the UI, and stale in the app. Any cache patch changes when a value is observed, not whether it was written — that class of bug surfaces only under concurrency or in long-lived processes..env is not a database. #, quotes, $, spaces, trailing backslashes and newlines are all dotenv semantics, not string data. My #1 App truncates silently. Unless the package quotes defensively, fields need ->rules('regex:/^[^#"\'\$\n]+$/').Password field round-tripping ******** over the real value is the classic data-loss mode of env editors and will not appear in casual testing.(bool) "false" is true. Requires trueValue('true')/falseValue('false') plus FILTER_VALIDATE_BOOLEAN at read time..env, silently loses a change.spatie/laravel-settings behind config does not touch application code.Key questions
.env actually live in each environment — file, injected, or read-only volume?config:cache here"?config/nova-settings.php, and who approves a change to a production value?Stack fit
.env in at least the environments where the tool is enabled..env does not exist, or where the filesystem is read-only. In those cases the tool either fails or creates a shadow .env that overrides injected values — worse than failing.Migration path
env() → config() call sites, which is a correctness improvement regardless of whether we adopt the package.env() → config() refactor and cache-invalidation policy first, prove them without the package, then add the package as a UI over a pipeline we already control. That order makes adoption reversible.config/nova-settings.php as the single declaration point, keep all reads going through config(), and the tool can be swapped for a custom Nova resource without touching application code.Compatibility
"stepanenko3/nova-settings": "1.1.2"). Verify the Nova major constraint explicitly; do not infer it from the README.src/ end-to-end before first deploy. It is a small package — roughly an hour — and it settles caching, quoting, save hook, and authorization questions that would otherwise be discovered in production.Sequencing
src/. Answer the six key questions. Confirm Nova major and field API. Exit criterion: a written go/no-go.env() → config() everywhere outside config/*.php. Decide and implement cache invalidation. Add .env.example diff check to CI.grep MY_KEY .env (quoting intact) → fresh php artisan tinker → a second long-lived process (queue worker) → confirm the 1.1.2 cache isn't serving stale reads.App #1, "quoted", pass$word, trailing backslash); backup-before-write; activity logging; ->readonly() on excluded keys.Gate::allows('manage-settings') plus a runbook covering queue:restart and octane:reload after every save.Maintenance
config/nova-settings.php as a schema, review additions, and reconcile it against .env periodically — orphaned keys written by hand survive rewrites but are invisible in the UI, which gets messy within a year.Support
grep the file (source of truth) → fresh php artisan tinker (bypasses config cache) → the web/queue process. That localises any stale value in under a minute..env quoting and boolean-as-string are the usual causes. Restricting field validation up front is cheaper than supporting free-text env edits.Scaling
queue:restart, and octane:reload where applicable. Put this next to the Save button, not in a wiki.Failure modes
Password field writes ******** back. Detect only via an explicit round-trip test.#, quotes, $, newlines. Detect via hostile-input tests..env writes out of the deploy pipeline while the tool is enabled, plus timestamped backups into storage/..env overriding injected platform values.APP_KEY rotation invalidates encrypted columns, sessions and password-reset tokens. The correct mitigation is exclusion or ->readonly(), not a warning label.Ramp-up
env() → config() refactor, which pays off independently.Mail, Payments, Features, Integrations) reads correctly to a non-developer. Group by blast radius, never by vendor — grouping by vendor pushes "is it safe to touch this?" onto the person least equipped to answer.Recommendation: adopt as a staging/local, internal-ops convenience with an exact pin, a one-week hardening budget, and a named owner. Do not treat it as the settings platform; if per-tenant config, audit trail, versioning, or approval flow is on the roadmap, fund that separately and let this package cover the interim.
How can I help you explore Laravel packages today?