An Eloquent trait for Laravel that adds query caching with a simple remember() method.
Rememberable is a Laravel package that adds query caching capabilities to Eloquent models through a trait. It allows developers to cache the results of database queries for a specified duration, reducing repetitive database calls and improving application performance. The package integrates seamlessly with Laravel's existing cache system.
Laravel developers building applications with high database query loads who want to implement caching without extensive configuration. It's particularly useful for those using Eloquent ORM and seeking to optimize performance.
Developers choose Rememberable for its simplicity and tight integration with Laravel's Eloquent ORM. It provides a straightforward API to cache queries with minimal code changes, avoiding the need for manual cache management while leveraging Laravel's built-in cache drivers.
Query caching for Laravel
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds a remember() method directly to Eloquent queries with minimal code changes, allowing caching via a trait as shown in the base model setup.
Supports cache tagging, custom prefixes, and driver selection via query methods or model properties, enabling tailored caching strategies without hardcoding.
Enables caching of eager-loaded relationships through callbacks, reducing database hits for nested queries, demonstrated in the usage examples.
Provides dontRemember() to bypass caching and flushCache() for tag-based invalidation, giving developers granular control over caching behavior.
Functionality is limited if using cache drivers without tag support, as admitted in the README, forcing reliance on prefixes or alternative workarounds.
Cannot delete cache for individual queries directly; flushing is only possible by tags, which complicates cache management for specific use cases.
Requires explicit serialization configuration for serializeable_classes in Laravel 13, adding setup complexity and risk of errors if overlooked.