Weave Code
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

Laravel Model Cache Laravel Package

ymigval/laravel-model-cache

View on GitHub
Deep Wiki
Context7
v1.2.1

Fixed

  • Fixed Bugs.
v1.2.0

What's Changed

  • fix: Compatibility with Laravel PR 58639 (ver. 12.51.0)

Introduces a minor update to the CacheableBuilder class, expanding its flexibility by allowing the firstOrCreate method to accept either a Closure or an array for the $values parameter.

v1.1.3

Fixed

  • HasCachedQueries trait requires explicit property definition.
v1.1.2

2025-05-21

Fixed

  • Fixed implementation of the ModelRelationships trait to properly handle BelongsToMany operations. Replaced the event-based approach (which was relying on non-existent Laravel events) with a custom BelongsToMany relationship class that flushes the cache after attach, detach, sync, syncWithoutDetaching, and updateExistingPivot operations.
  • Updated CachingBelongsToMany class to properly extend Laravel's BelongsToMany class and maintain the relationship contract. This resolves the "must return a relationship instance" error when accessing relationship properties after operations like attach() and detach().
v1.1.1

2025-05-19

Fixed

  • Fixed implementation of configuration for enabling or disabling cache: The model-cache.enabled configuration parameter is now properly checked in the HasCachedQueries trait, ensuring that when cache is disabled via configuration, the standard Eloquent builder is used instead of the cache-enabled version.
v1.1.0

2025-05-13

Added

  • Added support for custom cache prefix per model via $cachePrefix property
  • Added ModelRelationships trait to support cache invalidation for Eloquent relationship operations
  • Support for flushing cache on belongsToMany relationship events (saved, attached, detached, synced, updated)
  • New helper methods for relationship operations with automatic cache flushing: syncRelationshipAndFlushCache(), attachRelationshipAndFlushCache(), detachRelationshipAndFlushCache()
  • Debug logging for relationship-triggered cache flush operations when debug_mode is enabled

Fixed

  • Fixed issue with custom cache minutes ($cacheMinutes) definition at the model level
  • Improved cache invalidation when working with Eloquent relationships
  • Better handling of model relationship events to ensure cache consistency
v1.0.1

2025-05-04

Fixed

  • Add debug_mode config check for logger usage in model cache: This ensures logging of cache flush operations only occurs when debug_mode is explicitly enabled in the configuration. It reduces unnecessary log entries in production environments while retaining detailed logs for debugging purposes.
v1.0.0

2025-05-01

Added

  • Initial implementation of Eloquent model caching system
  • HasCachedQueries trait to enable caching on any model
  • Transparent integration with Laravel's query builder
  • Explicit methods for cache control (getFromCache(), firstFromCache())
  • Automatic cache invalidation when models are created, updated, deleted, or restored
  • Full cache tag support
  • mcache:flush Artisan command for manual cache clearing
  • Customizable configuration for cache duration, key prefix, and cache store
  • Compatibility with Laravel 8.x, 9.x, 10.x, 11.x, and 12.x
  • Support for PHP 7.4, 8.0, 8.1, 8.2, and 8.3
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky