Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Rememberable

Rememberable

MITPHP

An Eloquent trait for Laravel that adds query caching with a simple remember() method.

GitHubGitHub
1.1k stars92 forks0 contributors

What is Rememberable?

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.

Target Audience

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.

Value Proposition

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.

Overview

Query caching for Laravel

Use Cases

Best For

  • Caching frequently accessed database queries in Laravel applications
  • Reducing database load on high-traffic Laravel sites
  • Optimizing performance of Eloquent relationships with eager loading
  • Implementing tagged cache strategies for organized cache invalidation
  • Adding query caching to existing Laravel projects with minimal refactoring
  • Improving response times for repetitive read-heavy database operations

Not Ideal For

  • Projects requiring real-time data with frequent updates, as caching introduces staleness and may not reflect immediate changes.
  • Applications using cache drivers that don't support tagging (e.g., file or database cache), limiting organized cache management and invalidation.
  • Complex query systems with highly dynamic parameters where cache hit rates are low due to varied SQL queries.
  • Environments where precise cache invalidation per individual query is critical, since flushing is only possible by tags, not per query.

Pros & Cons

Pros

Seamless Eloquent Integration

Adds a remember() method directly to Eloquent queries with minimal code changes, allowing caching via a trait as shown in the base model setup.

Flexible Cache Configuration

Supports cache tagging, custom prefixes, and driver selection via query methods or model properties, enabling tailored caching strategies without hardcoding.

Relationship Caching Support

Enables caching of eager-loaded relationships through callbacks, reducing database hits for nested queries, demonstrated in the usage examples.

Easy Cache Control

Provides dontRemember() to bypass caching and flushCache() for tag-based invalidation, giving developers granular control over caching behavior.

Cons

Cache Tag Dependency

Functionality is limited if using cache drivers without tag support, as admitted in the README, forcing reliance on prefixes or alternative workarounds.

Limited Single Query Invalidation

Cannot delete cache for individual queries directly; flushing is only possible by tags, which complicates cache management for specific use cases.

Laravel 13 Configuration Hurdle

Requires explicit serialization configuration for serializeable_classes in Laravel 13, adding setup complexity and risk of errors if overlooked.

Frequently Asked Questions

Quick Stats

Stars1,127
Forks92
Contributors0
Open Issues6
Last commit8 months ago
CreatedSince 2015

Tags

#eloquent#orm#caching#laravel#laravel-package#cache#php#database-optimization#query-caching#performance

Built With

P
PHP
L
Laravel

Included in

Laravel13.0k
Auto-fetched 13 hours ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,596
Forks1,767
Last commit16 hours ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,303
Forks1,612
Last commit24 days ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,982
Forks1,194
Last commit18 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,390
Forks1,503
Last commit7 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub