matchory/response-cache
A Laravel middleware package that stores full HTTP responses and serves repeat requests straight from the cache instead of hitting your application. Configure which routes to cache, set lifetimes, and invalidate entries to cut response times and database load.
This is a first-pass assessment based on the 1.5.2 release. The headline is that the package now declares support for Laravel 12; the rest of the release is housekeeping (dev tooling), so the public API you'd learn day-to-day is unchanged from the rest of the 1.5.x line.
Minimal steps to get productive:
composer.json require block rather than trusting the changelog. A "support for Laravel 12" chore is usually a widened illuminate/* constraint (e.g. ^10.0|^11.0|^12.0) plus a bumped php floor. Check your app's php version satisfies it — Laravel 12 apps are on PHP 8.2+, and if the package bumped its minimum, older apps can silently fail resolution.composer require vendor/package:^1.5 --with-all-dependencies
Then verify only the intended packages moved: composer.lock diff should show the package and at most its transitive deps.php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider" --tag=config
Read every key and its default — for most Laravel packages 80% of day-to-day leverage is a handful of config flags, and defaults are chosen for the lowest common denominator, not your app.Wrap it behind your own boundary. Even for a package you like, don't call its facade from thirty places. Put a thin adapter or a small service class in app/ that owns the dependency, and inject that. When 2.0 lands (or when you swap the package out), you change one file. This also makes it trivial to fake in tests without relying on the package's own test helpers.
Config-driven, environment-scoped. Register the package's config in config/ and read it via config('package.key'), never env() at call time. If credentials or endpoints differ per environment, put them in .env and reference them only inside the config file so php artisan config:cache doesn't surprise you in staging.
Laravel 12 middleware registration. If the package ships middleware, the Laravel 12 skeleton has no app/Http/Kernel.php. Register it in bootstrap/app.php:
->withMiddleware(function (Middleware $middleware) {
$middleware->alias(['package-feature' => \Vendor\Package\Middleware\Feature::class]);
})
This is the single most common place a package that "supports Laravel 12" still needs you to do manual work, because provider-side registration and app-side registration are different things.
Queue the heavy paths. Anything the package does that touches the network or does non-trivial work belongs in a job, not a request cycle. Wrap the call in your own ShouldQueue job so retries, backoff, and failure handling are yours, and so you can move it to a dedicated queue later without touching callers.
Version-pin with intent. Use ^1.5 in composer.json and let the lockfile do the pinning. Do not pin to 1.5.2 exactly — you want patch fixes for a package that just proved it's tracking framework releases.
illuminate/* component or a dev-dependency that leaks into the runtime graph. Run composer update vendor/package --with-dependencies -W and actually read the lock diff.php artisan config:clear && php artisan cache:clear && composer dump-autoload (or optimize:clear). Stale package manifests and cached config are the cause of most "it worked locally" upgrade bugs with packages that publish config or register providers.composer update. After a minor release, diff the package's config/ against your published copy; new keys silently fall back to the package default (usually null or false), which can look like a bug.Factory/Manager class in the container. Most well-maintained Laravel packages let you $this->app->bind(...) a custom driver, and that's the supported upgrade-safe seam.dd(app(\Vendor\Package\Client::class)) — resolving the concrete class out of the container shows you the actual bound config and collaborators, which is often not what you assumed from the README.How can I help you explore Laravel packages today?