qiick/laravel-settings
Larablocks Analysis
qiick/laravel-settings works with Laravel 12 and 13 (latest release v0.1.0-beta.2, Nov 28, 2026).
Recommendation checks
Use with careUse with care: meets 2 of 5 checks.
- Works with Laravel 13, the current version
- Pre-release in the last 12 months (Nov 28, 2026); no stable release yet
- First released under 90 days ago
- 1,222 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Too new to judge- Last release (pre-release): Nov 28, 2026.
- 2 releases in the last 12 months, all pre-releases.
- First released: Nov 26, 2026.
- Monthly downloads: 1,222.
- 8 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require qiick/laravel-settings:v0.1.0-beta.2 |
|
| Latest Version: | v0.1.0-beta.2 |
| PHP: | ^8.3 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Dec 1, 2026 |
| Links: | GitHub · Packagist |
qiick/laravel-settings
PHPStan at max and the existing CI checks cover PHP. CodeQL covers GitHub Actions and JavaScript/TypeScript.
Scoped, typed settings and encrypted secrets for qiick Laravel products.
Pre-release.
0.1.0-beta.2is on Packagist for qiick products. Public APIs and the storage schema can change before 1.0.0. See the upgrade guide before adopting it in a product with existing settings.
Requirements
PHP 8.3 or later in the 8.x series, and Laravel 12 or 13.
Installation
Install the beta from Packagist in your Laravel application.
composer require qiick/laravel-settings:^0.1@beta
Configuration
Publish the configuration if the application needs to override a default. Run the migrations before the deploy check.
php artisan vendor:publish --tag=settings-config
php artisan migrate
php artisan settings:check
Declaring settings
Implement Qiick\Settings\Contracts\SettingsSchemaContract and tag the implementation in your Laravel service provider with SettingsSchemaContract::class. Declare each setting key once across all tagged schemas.
return [
Definition::bool('two_factor_required')->default(false),
Definition::json('sidebar_modules')->default(fn () => ['overview' => true]),
Definition::enum('password_policy', PasswordPolicy::class)->default(PasswordPolicy::Required),
Definition::string('oidc_client_secret')->secret(),
];
Definitions use the app group and allow only the instance scope by default. Use in() and scopes() to opt into other groups and scopes. Closures supply defaults on demand.
json() accepts PHP lists and associative arrays. An enum definition accepts instances of the declared backed enum and stores their backing values. A stored backing value that fails validation falls back to the default and reports SettingTypeMismatchException.
Secret definitions use string()->secret() and have a null default. The package reads secrets from encrypted database values. Products that provide their own environment fallback handle it in application code.
Organisations and inheritance
ScopeRef::userInOrganisation($user, $organisationUuid) addresses a user's settings inside one organisation; ScopeRef::user($user) stays their global settings, and both can coexist. ScopeRef::organisation($uuid) is the organisation's own settings. The organisation is part of the natural key, so each is its own group with its own revision.
A definition with ->inherits() reads, when its scope stores no value, the organisation's value (for a per-organisation scope), then the instance value, then the default, each level only when the definition declares that scope:
Definition::string('theme')->scopes('instance', 'organisation', 'user')->default('light')->inherits();
forEdit() always shows the scope's own values, so an edit form never saves an inherited value as the scope's own. Without inherits(), reads never look past their scope.
Changing a value's shape
When the shape of a stored value changes, give the definition a new version and an upcaster instead of migrating rows (which may be encrypted):
Definition::json('layout')->scopes('user')->version(2, fn (mixed $stored, int $storedVersion): array => ['columns' => $stored]);
Writes store the version in value_version; a read of an older row passes the stored value through the upcaster, and a row newer than the definition (written by a later release) reads the default and reports SettingTypeMismatchException. Secrets cannot be versioned.
History
Every write passes each key to SettingsChangeRecorderContract inside its transaction, with old and new values (secrets as [redacted]), the revision and the actor. The package binds a no-op; qiick/laravel-audit records the changes in the activity log when it is installed, and a product can bind its own recorder. A recorder that throws rolls the write back.
Reading and editing settings
Resolve Qiick\Settings\Contracts\SettingsContract from the Laravel container. Typed reads use the stored value or the declared default. Ordinary group reads omit secrets, and forEdit() exposes a has_<key> flag. Call secret($key)?->reveal() when the caller needs plaintext.
Typed reads throw InvalidArgumentException for an undeclared key, a type or enum mismatch, or a scope the definition does not allow. When a stored non-secret value fails validation, the reader reports SettingTypeMismatchException and returns the declared default.
After a set() or forget() commits, SettingsUpdatedEvent carries the scope, group and changed key names.
Read the group's revision($group, $scope) before reading its edit values. Pass that revision as expectedRevision to set() when saving. A conditional write targets one group and throws StaleSettingException if another write changed its revision. The revision is monotonic across writes and clears. An empty group starts at zero.
forget() clears the stored value and advances the revision, so subsequent reads use the default. An unconditional set() can update several groups in one transaction.
Request and job memoization
Each request or job reads committed settings from the database and reuses the result for that group within the same scope. Reads inside a transaction go directly to the database. Writes invalidate the memo after the outer transaction commits. The memo holds only ciphertext for secret settings. A fresh request or job sees changes committed by other processes.
User erasure
Resolve Qiick\Settings\Erasure\SettingsEraser from Laravel in the product's erasure orchestrator. A full erasure deletes the user's settings (global and per organisation), clears the user as updated_by on rows they last wrote in other scopes, and clears their request or job memo after commit. With an organisation ID it does the same only for rows of that organisation, which serves removing a person from one organisation. See the public API for arguments and reporting.
Maintenance commands
settings:verify checks declared keys, scopes and stored encryption.
Encryption format and key rotation
A secret's encryption column names its format: v2:<cipher>:<key id>, where <cipher> is the app.cipher it was written with and <key id> a 16-hex one-way fingerprint of the APP_KEY that wrote it. Reads take that key from APP_KEY / APP_PREVIOUS_KEYS and that cipher, so a key rotation or an app.cipher change keeps every row readable without a table migration. Rows written before this format carry laravel-v1, a bare Laravel payload read with the current app.cipher, APP_KEY and APP_PREVIOUS_KEYS. Any other marker, an unsupported cipher or a key id no configured key matches fails closed (UndecryptableSettingException).
To rotate APP_KEY:
- Move the old key into
APP_PREVIOUS_KEYS, set the newAPP_KEYand deploy. New writes use the new key; old rows still read. php artisan settings:reencrypt --dry-runcounts rows under a previous key, an old cipher orlaravel-v1;php artisan settings:reencryptmoves them to the current marker under the group write lock. It exits non-zero, without printing a value, when a row cannot be read.- Run
settings:verify, and once a dry run reports0rows, remove the old key fromAPP_PREVIOUS_KEYS. Keep that key with any export or database backup taken before step 2: restoring it needs the key it was encrypted with.
To change app.cipher, run settings:reencrypt first so no laravel-v1 row is left (it names no cipher and is read with the current one), then change the cipher (with a key of the length it needs, keeping the old key in APP_PREVIOUS_KEYS if it changes) and run settings:reencrypt again. A later format version ships as a reader first and becomes the writer one release later, so a rollback still reads every row.
php artisan settings:export > settings.json
php artisan settings:import settings.json --dry-run
php artisan settings:import settings.json
The JSON export contains ciphertext bound to the current APP_KEY; export refuses a secret that only a previous key reads, so run settings:reencrypt first. Treat it as a database backup and protect it accordingly. Use the same key and declared schema when restoring. The import validates the entire file before writing and restores revision, metadata and timestamps in one transaction on an empty settings table. Dry run validates the file without changing storage.
Threat model
Assets. Product configuration that changes security behaviour (two-factor requirements, password policy, alert routing) and the secrets stored next to it (OIDC client secrets, webhook and API credentials).
Trust boundaries. Values written through SettingsContract::set() come from product code, often from an admin form: the package treats the key, scope and value as untrusted and validates them against the declared schema. The product decides who may edit which scope (its Policies). The application's APP_KEY and database credentials are trusted.
| Threat | Control | Checklist |
|---|---|---|
Duplicate instance rows through a NULL scope ID |
scope_id is never null; unique natural key (scope, scope ID, group, key) with case-sensitive identity on every engine |
S1 |
| A secret leaks into a page, log, exception or memo | forEdit() exposes has_<key> only; Secret redacts every representation; the memo holds ciphertext |
S2 |
| A declared secret is stored in plaintext | writes encrypt (encryption = v2:<cipher>:<key id>); settings:verify fails on a plaintext row |
S3 |
| Mass assignment of arbitrary keys | writes refuse undeclared keys and keys outside the definition's scopes | S4 |
| Scope confusion | unregistered scopes and non-empty IDs for instance-like scopes are refused; authorization stays in the product Policy | S5 |
| Stale security settings in workers | per-request or per-job memo, refreshed from committed data | S6 |
| A rolled-back write poisons the memo | the memo is invalidated after the outer commit only | S7 |
| Lost update between two admins | group revision with expectedRevision, and 64 ordered write-lock buckets (crc32 of scope, ID and group) that serialise writers even before a group's first row exists |
S8, SettingsWriteRaceTest |
| Key rotation breaks secrets | APP_PREVIOUS_KEYS keeps them readable; settings:reencrypt moves rows under the group lock |
S9 |
| An undecryptable secret enables a default (fail open) | strict mode throws UndecryptableSettingException; non-strict reads it as absent |
S10 |
| A partial write or restore | multi-group writes, archive imports and the eraser each run in one transaction; an import validates the whole file before writing | SettingsRuntimeTest, SettingsArchiveTest |
Out of scope, owned by the product. Authorization of who edits which scope, environment-variable fallbacks for secrets, protection of settings:export files (they hold ciphertext bound to APP_KEY), database backups, and the APP_KEY itself: anyone holding it and the database can read every secret.
How each design standard is met: docs/standards-traceability.md.
License
Related Packages
A Laravel Nova tool for editing custom settings using native Nova fields.
A Laravel Nova tool for editing custom settings using native Nova fields.
Version History
Pre-releases (2)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.1.0-beta.2 | ^8.3 | ^12.0 || | MIT | |
| v0.1.0-beta.1 | ^8.3 | ^12.0 || | MIT |