Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Settings Laravel Package

egough/laravel-settings

egough/laravel-settings provides a simple, flexible way to manage application settings in Laravel. Store key-value configuration in the database, read and update settings at runtime through a clean API, and benefit from built-in caching for fast access.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Recommendation: Adopt only as a narrow, contained solution — suitable for an internal admin-controlled settings/flag store in a single-team Laravel application, not as a platform dependency for multi-tenant SaaS or anything on a revenue-critical path without an internal owner and a fork contingency.

Architecture fit. The package is a conventional Laravel service provider: publishable config and migrations, a SettingsManager resolvable from the container, a Settings facade plus settings() helper, a Flag facade plus flag() helper, Blade directives (@setting, @hasSetting, @hasFlag), three lifecycle events (SettingCreated, SettingUpdated, SettingDeleted), a cache layer, and Artisan commands (settings:get, settings:set, settings:clear-cache). Two distinct scopes — global and per-Eloquent-model — are exposed through a HasSettings trait. This is exactly the shape a Laravel team expects, so it slots in without architectural debate. The design intent is coherent: reads resolve stored value → settings.defaults → caller fallback, writes clear cache and emit events after commit.

Integration feasibility. Low effort. Two vendor:publish calls, one migrate, and you can be writing settings the same afternoon. The API surface is small enough to audit in a single sitting. The existence of a packaged agent skill (documenting gotchas like stored-null precedence, literal dotted keys, boolean string coercion, and after-commit event behavior) materially reduces discovery cost — that documentation quality is stronger than the star count implies.

Technical risk. The dominant risk is adoption signal, not code quality: 4 stars, 0 dependents, effectively no third-party validation, and a single named maintainer. The reported last release of 2026-10-27 is a future/anomalous date and should be treated as a metadata or registry integrity issue to verify directly against Packagist and the repo's tag history before pinning. Concrete technical hazards identified from the documentation:

  • Model PK type assumption. The implementation casts model IDs to integers, which is a hard incompatibility with UUID/ULID or string-keyed models — a blocking constraint for many modern Laravel schemas.
  • No scope inheritance. Model settings do not inherit global values or config defaults. This will be read as a bug by most product stakeholders and must be designed around explicitly.
  • Write-path discipline required. Direct repository, Eloquent, or raw SQL writes bypass both cache invalidation and event dispatch. Any admin UI, backfill script, or data migration that writes to the settings table outside the manager produces silent staleness and missed side effects.
  • Typed-value footguns. settings:set without --type stores strings; 'false' is truthy under flag casting; a stored null overrides defaults. These are cheap to hit and expensive to debug in production.
  • Boot-time unavailability. Settings requiring a database read cannot serve configuration needed during application boot; secrets and boot-critical config must remain in env/config, which creates two parallel configuration planes to govern.

Key questions for the maintainer / spikes.

  1. Version support matrix: which Laravel and PHP versions are tested in CI, and is there a published compatibility table?
  2. Is multi-tenant scoping supported beyond per-model owners (tenant ID column, connection awareness), and how are tenant-scoped cache keys shaped?
  3. Does the package work correctly with array, database, redis, and dynamodb cache stores, and with multi-node deployments where cache is shared?
  4. What is the write concurrency model — last-write-wins, or is there locking/optimistic concurrency on settings:set?
  5. Is there any audit trail (who changed what, when), and is encryption supported for secret-valued keys?
  6. What is the bus factor plan — named backup maintainer, response SLA on issues, security disclosure process?
  7. Does it coexist with spatie/laravel-settings or similar (table names, config keys, helper function collisions) if we already have one installed?
  8. Actual test coverage and CI status, plus whether the 2026-10-27 release date is a real tag or registry noise.

Integration Approach

Stack fit. Best fit: single-tenant or team-scoped Laravel monoliths on integer-keyed Eloquent models, already using Redis or a shared cache, where a small product-ops surface (site name, branding, upload limits, kill switches) needs to change without deploys. Poor fit: UUID/ULID models, polyglot services needing the same flags (this is Laravel-only; other services would need an API layer), or organizations that require a vendor with support terms.

Migration path. Two inbound paths, both tractable:

  1. From hardcoded config/env. Move non-secret, runtime-tunable values into settings.defaults as literal dotted keys, keeping env/config as the boot-time baseline. Ship the defaults array first with no stored rows so behavior is unchanged, then let ops override at runtime. This makes the migration a no-op release until someone writes a value.
  2. From another settings package. Requires a data migration that reads the legacy store and writes through the manager API — not raw SQL — so cache and events stay consistent. Budget for key-namespace translation, since dotted keys here are literal strings rather than nested paths, and for resolving the scope-inheritance gap by materializing inherited values explicitly per model where the old package inherited.

Compatibility checks before the first commit. Confirm Laravel/PHP constraints against the app's version; audit existing helper and facade names for settings()/flag() collisions; verify the settings table name does not clash with existing schema; confirm every model intended for HasSettings has an integer primary key; confirm the app's cache store is shared across all nodes; and confirm the boot sequence never needs a setting before the DB is reachable.

Sequencing.

  1. Spike (1 week). Install in a scratch branch, run the documented test cases (native-type round-trip, stored-null vs missing, two-owner isolation, cache-primed write, event payloads, transaction rollback suppression), and verify the UUID-PK limitation and release-date metadata.
  2. Low-risk globals. Land settings.defaults for cosmetic/tunable values behind no behavior change; add one admin write path only through the facade/manager.
  3. Kill switches. Introduce flags for a single feature with an existing fallback path, so a flag-read failure degrades to the current behavior. Instrument the read path before trusting it.
  4. Event-driven side effects. Add SettingUpdated listeners only after step 3 is stable, filtering on both key and model === null, and confirm listeners are not silently deferred by wrapping test transactions.
  5. Model-scoped preferences. Roll out per-user UI preferences, making inheritance explicit at the call site rather than assuming it.
  6. Admin surface. Build or buy a small backoffice. Treat this as required scope, not optional — without it the package is an API only engineers can use, and hand-edited rows reintroduce the cache-staleness failure mode. Enforce typed writes (--type=bool, --type=int) in the UI and in any CLI runbook.

Exit plan. MIT licensing plus a small, auditable codebase means forking is realistic. Keep the integration behind a thin internal adapter (a SettingsService wrapper or repository interface) so swapping to an in-house implementation or spatie/laravel-settings is a contained change rather than a search-and-replace across the codebase. Pin exact versions and avoid depending on undocumented internals.

Operational Impact

Maintenance. Bus factor of one, no dependents, and no visible commercial backing. Treat the package as internal code you happen to have downloaded: assign a named internal owner, subscribe to repo releases and security advisories, and run a quarterly review of pinned version versus upstream. The realistic 3-year cost is not bug-fixing the package but maintaining the fork and re-validating against each Laravel major. Weigh that against the ~200-line replacement cost of a settings table, cache decorator, and two helpers — for many teams, building in-house is the lower-TCO option once the fork obligation is priced in.

Support. No vendor SLA, no paid support, community issue resolution on a best-effort basis. Internal documentation must capture the semantics that will otherwise generate support tickets: literal dotted keys, stored-null precedence, no cross-scope inheritance, 'false' truthiness, and string-typed Artisan writes. The packaged agent skill is a good starting point for that runbook and worth adapting into the team wiki.

Scaling. Reads are cache-backed with configurable ttl (null = forever), so steady-state read cost is a cache round-trip, not a query. Two scaling caveats: (a) the global cache appears to be keyed by a single configured key, meaning every global write invalidates the whole global set and can drive refresh storms under high write frequency — acceptable for ops-driven changes, risky if any code path writes settings per-request; (b) model cache uses a key_prefix plus owner identity, so per-user settings multiply cache keys linearly with the active user base — set a finite TTL and monitor cache memory. Writes are DB-bound and should be treated as low-frequency control-plane operations, never on a hot request path. Multi-region or multi-cluster deployments need a shared cache or they will serve divergent settings.

Failure modes to instrument and alert on.

  • Silent staleness: writes outside the manager leave stale cache with no event; detect via a reconciliation job comparing cache to table, or forbid non-manager writes in code review and via DB permissions.
  • Missed side effects: SettingDeleted on a missing key and updates to an equal value emit nothing — listener logic must not assume a 1:1 change/event mapping, and consumers must listen to both created and updated.
  • Transaction traps: events dispatch after commit and are discarded on rollback; test suites wrapped in an uncommitted transaction will appear to swallow them, and long-running transactions delay side effects.
  • Precedence surprises: stored null beats defaults while @hasSetting fails on it — a plausible source of "the setting is set but the page is blank" incidents.
  • Type drift: string-stored booleans/int write through CLI or raw SQL and break flag evaluation and numeric comparisons.
  • Boot dependency: any attempt to read a setting before the DB is available turns a config concern into an availability incident.

Ramp-up. Roughly half a day for a mid-level Laravel developer to ship the first setting; the small API, familiar facade/helper idioms, and the packaged skill documentation support that estimate. The real ramp-up cost is cultural, not syntactic: teams must internalize the scope-separation and write-path rules or they will corrupt cache state. Plan for a short internal brown-bag, a documented runbook of do/don't rules, and a lint or code-review checklist that flags direct writes to the settings table. Full team fluency, including the admin surface and incident response for stale settings, is realistically 1–2 weeks of an engineer's attention before the package is safe to operate without supervision.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle