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

Eloquent Cache Laravel Package

authentik/eloquent-cache

Eloquent Cache adds automatic query caching to Laravel models, storing results in your configured cache driver and invalidating them on create, update, and delete. Speed up repeated database reads with almost no code changes.

View on GitHub
Deep Wiki
Context7

Easily cache your Laravel's Eloquent models.

Frequently asked questions about Eloquent Cache
How do I install authentik/eloquent-cache in a Laravel app?
Install authentik/eloquent-cache with Composer, then follow the package's service provider registration and config publishing steps for your Laravel version. Integration is opt-in per model, so you can enable caching on one low-risk, read-heavy model before rolling it out further. Confirm the package supports your exact Laravel and PHP versions before piloting.
Which Laravel and PHP versions does authentik/eloquent-cache support?
The last release was April 2023, so the package most likely targets Laravel 9 or 10 rather than Laravel 11 or 12. PHP 8.1+ compatibility should be verified, and you should run the package's test suite on your exact Laravel minor version. Treat Laravel 11/12 support as unconfirmed until you validate it in a compatibility spike.
Does authentik/eloquent-cache work with Redis, Memcached, database, or file cache drivers?
It stores cached results through Laravel's cache abstraction, so it composes with whatever driver you already have configured, including Redis, Memcached, database, and file. Redis or Memcached is the sensible prerequisite for a serious pilot because database and file drivers offer marginal gains and add operational risk. Confirm the package declares support for your chosen driver before relying on it.
How does cache invalidation work in authentik/eloquent-cache?
The package layers invalidation on top of Eloquent model events, so create, update, and delete operations trigger cache clearing. The exact mechanism, whether model observers, cache tags, versioned keys, or TTL-only, should be confirmed by reading the source before you commit. TTL settings may also affect how long stale entries can survive if an event is missed.
Does the package invalidate cache on bulk updates or raw SQL queries?
Bulk operations such as Model::where(...)->update() and raw SQL statements do not fire normal Eloquent model events, so they are a classic invalidation blind spot. You should test these write paths explicitly and flush or version the cache manually if the package does not cover them. Silent stale data, not an exception, is the likely failure mode.
Is GPL-3.0 a problem for commercial or proprietary Laravel applications?
GPL-3.0 is a copyleft license, and linking the package into a proprietary SaaS or commercial product raises a real compliance question. Resolve it with legal before any engineering investment, and plan a fork or rewrite if GPL-3.0 is unacceptable. This is the single largest gating item in the evaluation.
Is authentik/eloquent-cache actively maintained and safe for production?
The project has roughly 57 stars, zero dependents, a single maintainer, and no release since April 2023, which means thin real-world battle-testing and a small community for edge cases. It can still be evaluated, but pilot it on one non-critical, read-heavy domain with monitoring for stale reads. Have a fork or replacement plan if the maintainer becomes unresponsive.
How do I test that cached Eloquent models do not return stale data?
Write integration tests that enable the cache and exercise create, update, delete, bulk update, and relationship read paths against a real cache driver. Compare cached results with uncached queries and assert that writes invalidate the expected keys. In production, monitor cache hit rate and stale-read incidents during the pilot.
How are Eloquent relationships and eager-loaded models handled by the cache?
The evaluation notes do not confirm whether relationships and eager-loaded models are cached as part of the parent or independently. Cross-model relationship staleness is a known risk, so test parent and child updates separately. Review the package source or docs for relationship handling before caching models with heavy relationship graphs.
What are alternatives to authentik/eloquent-cache for caching Eloquent queries in Laravel?
Common alternatives include Laravel's native Cache::remember around query results, watson/rememberable for Eloquent query caching, or a custom repository or decorator layer with explicit invalidation. Each option trades convenience against control over invalidation, tags, and key cardinality. Compare them against authentik/eloquent-cache on license, maintenance, and bulk-write handling.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections