barchart/laravel-remember-all
A Laravel package that remembers all query string parameters across requests, making it easy to preserve filters, sorting, and pagination as users navigate away and back.
Architecture fit. This is a read-path optimisation that sits inside the Eloquent query builder, not in the request lifecycle or the data model. It reintroduces an ergonomic, query-level caching primitive — the remember()-style API Laravel removed from the query builder back in 5.8 — and extends it two ways: a rememberAll() call that caches a full chain, and a global/per-model opt-in so no call sites change. For a TPM that means the blast radius is bounded to code that issues reads, there are no migrations, no schema changes, and no service provider behaviour that should alter boot or routing. The architectural concern is not integration surface, it is semantic surface: wrapping a query in a cache changes its consistency guarantees, and doing so globally means the decision is made once at config level and inherited silently by every read in the model.
Integration feasibility. Mechanically trivial — a Composer require, an optional config publish, an optional trait. The real feasibility question is framework currency. The package declares Laravel 8+ / PHP 8+ and its final release (2022-09-30) exists to add Laravel 9 support. It is archived, which is a hard fact, not an inference: there is no Laravel 10, 11, or 12 path, no PHP 8.2/8.3 validation, and no security response channel. On a Laravel 8/9 estate it will install; on anything newer it is either unresolvable or resolving-but-unverified, which is worse. Treat the supported window as closed at L9.
Technical risk. Four risks dominate, in descending order of business impact.
Key questions.
composer.json anywhere in the estate today, and if so, which services and which framework versions?Stack fit. Only viable on Laravel 8 or 9 with PHP 8.x, and only for read-heavy, consistency-tolerant workloads — reporting, catalogue and listing pages, reference data, dashboards, search facets. It is explicitly not a fit for anything on a Laravel 10+ upgrade path, because adopting it there creates a dependency we know we must remove within the planning horizon. That single constraint should decide the decision for most estates: adopting an archived package as you move forward in framework versions buys a short-term latency win for a guaranteed future migration.
Migration path. Do not adopt this as a long-lived dependency. The correct framing is buy-time, not build-time: use it to close a specific latency gap inside one release cycle, with a pre-agreed exit. Concretely:
rememberAll() is a builder macro or a trait method, because that determines whether it composes with our existing scopes and pagination.CachedQuery helper or a base repository method — so that replacing the package with a ~60-line in-house trait is a one-file change, not a find-and-replace across the codebase.rememberAll($ttl) at audited call sites over global config. Global mode is the feature that makes this package attractive and the feature that makes it dangerous; it can be enabled later once we have hit-rate and staleness data.1.3.0, not ^1.3) and record the pin in the dependency register with an owner and a review date, since no upstream will ever move it.Compatibility. Two axes to pin ourselves rather than inherit: the package constraint and the framework constraint. Snapshot the lockfile diff at adoption so any transitive movement is visible. If the package publishes config, commit it and diff it on any future change — there will not be one, but the committed artefact is the documentation. Verify PHP 8.0/8.1 explicitly; the package predates 8.2 and will not have been tested against it.
Sequencing.
Maintenance. The maintenance burden is inverted from a normal dependency: there is no upgrade treadmill because there is no upstream, and instead a permanent, low-grade ownership cost. The code is small and MIT-licensed, so the realistic posture is "adopt as if forked" — we own the source, we vendored or can vendor it, and we carry the responsibility for any framework incompatibility. Budget for a named owner and a scheduled review at the next Laravel major, at which point the expected outcome is replacement, not upgrade. The good news is the exit cost is low; the bad news is that a low exit cost is also an argument for skipping the dependency and writing the trait directly.
Support. Effectively none. No maintainer, no issue triage, no security disclosure channel, no CVE response. For a package that sits between the application and its primary datastore, and whose failure mode includes serving one tenant another tenant's rows, "no security response channel" is the single most important line in this assessment. It is acceptable only where the alternative — an unmitigated latency or load problem — is the larger risk, and only with the tenant-key question answered in writing.
Scaling. Application-layer scaling is unaffected; the constraint is on the cache tier. Per-query keys mean key cardinality scales with query variety, not with data volume, so memory growth is driven by the number of distinct SQL+binding combinations — which is to say, by long-tail filters and pagination. Forecast this against the existing Redis budget before enabling broadly, set an eviction policy deliberately, and expect the eviction policy to interact with TTL expiry to produce the stampede case. The organisational scaling note from the dependency side also applies: every service that adopts this multiplies the eventual replacement work, so centralise the decision in one owner rather than letting teams pin independently.
Failure modes.
Ramp-up. Low for engineers — a trait or macro, a config file, a TTL. The real ramp-up cost is on the reviewer and the on-call: someone must own the consistency-tolerance judgement per call site, and someone must be able to explain, during an incident, why a user is seeing yesterday's number. Budget that as design and review time, not implementation time. Realistically a senior engineer-day to audit and pilot, versus roughly the same to write the equivalent internal trait — which is why the recommendation for most teams should be do not adopt; reimplement the pattern internally behind the same API, capturing the ergonomics without inheriting an archived dependency whose failure modes touch tenant isolation. Adopt only where a service is pinned to Laravel 8/9, the latency problem is real and measured, and the tenant-key question has a documented answer.
How can I help you explore Laravel packages today?