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
Laminas Cache

Laminas Cache Laravel Package

laminas/laminas-cache

Laminas Cache is a PHP caching component with PSR-6 and PSR-16 compliant adapters, multiple storage backends such as filesystem, memory, Redis, and more, plus cache patterns and integration for Laminas and Mezzio applications.

View on GitHub
Deep Wiki
Context7

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

Frequently asked questions about Laminas Cache
What is laminas/laminas-cache and when should I use it in Laravel?
Laminas Cache is a PHP caching component with PSR-6 and PSR-16 adapters plus storage backends such as filesystem, memory, and Redis. In Laravel, it is most relevant when you need a specific adapter, plugin behavior, or legacy Laminas/Zend compatibility. For simple caching, Laravel's native cache is usually the better default.
How do I install laminas/laminas-cache in a Laravel project?
Run composer require laminas/laminas-cache and install the storage adapter package for your backend, such as the Redis adapter if needed. Then bind the adapter or register a custom Laravel cache store in a service provider. The package does not ship a Laravel service provider, so configuration stays in your application.
Is laminas/laminas-cache compatible with Laravel, and which versions?
The package is framework-agnostic and not tied to a specific Laravel release; integration relies on Laravel's custom cache store API and a PSR-16 decorator. Validate it on your target Laravel version, especially if you use newer PHP or Laravel features. There is no Laravel-specific service provider to guarantee version support.
How do I register Laminas Cache as a Laravel cache store?
Use Cache::extend('laminas', ...) in a service provider and return a SimpleCacheDecorator wrapping a configured Laminas storage adapter. Keep adapter settings in config/cache.php so environment-specific hosts and options stay manageable. After registration, access it with Cache::store('laminas').
Is laminas/laminas-cache PSR-16 compliant?
Yes, Laminas Cache provides PSR-6 and PSR-16 compliant adapters, and SimpleCacheDecorator exposes a PSR-16 interface. That makes it consumable by Laravel through a custom cache store. Check that the adapter you choose implements the expected PSR interface.
Which storage adapters does laminas/laminas-cache support, including Redis and filesystem?
It supports filesystem, memory, Redis, Memcached, DBA, and custom adapters, though some adapters are separate Composer packages. For Redis, create the storage adapter through the adapter factory and pass host and connection settings from config/cache.php. Confirm the specific adapter package is installed and maintained for your PHP version.
How should I handle TTLs when using Laminas Cache with Laravel?
Laminas Cache can accept DateInterval TTLs while Laravel commonly passes integer seconds. Normalize TTL values in a service layer or adapter wrapper before calling the Laminas storage adapter. Test expiration and zero or negative TTL behavior because semantics can differ.
What serialization problems can occur with Laminas Cache and Laravel models?
Some Laminas adapters require explicit serialization plugins, and complex objects, closures, and resources can fail or behave unexpectedly. Eloquent models and value objects should be tested explicitly before caching. Add serialization plugins only when needed and verify cache invalidation.
Is Laminas Cache a good alternative to Laravel's native cache?
Laravel's native cache is simpler and already supports PSR-16, so Laminas Cache is usually not a drop-in replacement. Consider it when you need additional adapters, plugin-based serialization or exception behavior, or legacy Laminas/Zend compatibility. Benchmark critical paths because adapter and plugin choices can add latency.
What changed in laminas/laminas-cache 3.14.1, and how should I test and maintain the integration in production?
Version 3.14.1 is a maintenance patch that removes a broken README example and replaces methods deprecated in PHP 8.5; it does not add new integration features or breaking changes. Confirm whether your team targets the 3.14.x line or the 4.x line, because the prior assessment referenced 4.3.0 and mixing assumptions is a process risk. In production, test serialization, TTL normalization, adapter failures, and cache invalidation, and pin Composer constraints to the correct major/minor line. Keep an internal Laravel integration example because the removed standalone README example should not be relied on.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core