All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- pivotSynced event listener to flush cache when performing BelongsToMany::sync
[...]
- The from part of the query ($query->from) instead of the table name of the model ($model->table) is now used for determining the table part caching key fragment
- functionality to inject custom builder class for handling conflicting packages.
- typos in test class.
- PREDIS dependency. Going forward testing will be done against PHPREDIS, as that is installed by default on Laravel Forge servers and the officially recommended Redis client, since PREDIS is no longer maintained.
- support for PHP 7.2 due to incompatibility.
- update and insert methods when called on cached relations.
- changes meant for 0.8.8 that were inadvertently not committed.
- return type of
applyScopes
to match parent class.
- check for scopes to avoid them being applied twice. Thanks @saernz!
- implementation of
debug_backtrace()
to reduce memory consumption. Thanks @saernz!
- PHP dependency version to ">=7.2.5" to be more inline with Laravel.
- additional unit tests.
- key generation to be more explicit in details with global scopes. Thanks @Drewdan!
- initial tests for Nova integration. Thanks @dmason30!
- travis build process, tests on travis are now back to green!!!
- issue with incorrectly adding to currentBinding if item was not in query binding. Thanks @irvine1231!
jsonContains()
with array values. Thanks @dmason30!truncate()
to flush cache. Thanks @dmason30!
- Laravel 7 compatibility.
- documentation to explain that database transactions are currently not supported.
- compatibility with binary UUIDs. Thanks @padre!
- detection if cache is enabled in the
$model->all()
method. Thanks @titrxw!
- improper caching of non-cachable eagerloaded relationships. Now any query with non-cachable eagerloaded relationships will not be cached in its entirety to prevent stale data. Special thanks to @Hornet-Wing for his help in this.
- dependency version constraints.
- various tests.
- Laravel 6.0 support.
- caching of methods that could pass field names as string or array.
- 'modelCache:publish' artisan command.
- Spatie's QueryBuilder package to list of incompatible packages.
- registration of config file in service provider.
- detection if cache is disabled.
- flushing of cache for pivot events.
- config and environment variable to allow removal of database information from cache-key.
- environment variable
MODEL_CACHE_DISABLED
toMODEL_CACHE_ENABLED
to better conform to standards.
- how cache key is constructed for SQLite.
- all use of helper methods to allow non-Laravel apps to use this package:
- app()
- config()
- cache()
- db()
- now()
- request()
- parsing of soft-deleted-related queries:
- withTrashed()
- onlyTrashed()
- withoutTrashed()
- parsing of global scopes. Rewrote how global scopes are analyzed to create appropriate cache key.
- calling
flushCache()
on non-cachable related models.
Pushed changes intended for 0.5.1. Forgot to push changes to repo. 👀
- caching of where clauses using DateTime instead of Carbon.
- implementation of model-based cache prefix.
- the way tests are run to be MUCH more performant.
- dead code.
- BelongsToMany relationship to not cache if the target model is not also cachable.
- tests for lazy-loading the following relationships:
- BelongsTo
- BelongsToMany
- HasMany
- HasOne
- BelongsToMany relationship cache not being automatically invalidated.
- issue introduce in previous release related to cache cooldown and prefixes.
- my own implementation of laravel pivot events, based on
fico7489/laravel-pivot
.
- Laravel Telescope compatibility.
- dependency on
fico7489/laravel-pivot
.
- caching lazy-loading of belongs-to relationships. Thanks @tmishutin for leading the way forward on this effort! Hopefully this solution will work as a template for lazy-loading other relationship types going forward.
- an issue with prefixing found during testing.
- unused code.
- work-around for Laravel Telescope compatibility to README.
- polymorphic relationship caching, as well as other queries using
InRaw
.
- generation of cache key where clauses.
- the way the database name is determined when creating the cache prefix.
- bindings used in
whereIn
clauses.
- where
first()
didn't pass an array parameter.
- helper function to run closure with model-caching disabled. Thanks for the suggestion, @mycarrysun
- string and array helpers to use the
Str
andArr
classes directly, in preparation for helper deprecations in Laravel 5.9. Thanks @mycarrysun
- disabling of model caching on relationship queries if model caching was disabled on the model. Thanks @mycarrysun
- error that occurred if
whereIn
was given an empty array. Thanks @Ben52
useCacheCooldown
tocacheCooldownSeconds
in models.
- cache cool down functionality to not trigger if it is not set on the model. This should hopefully improve performance. Thanks @mycarrysun for implementing the PR, and thanks @yemenifree for alerting me to the issue!
laravel-pivot
dependency back to that of the original owner, as Laravel 5.8 compatibility has been restored.
- to rely on temporarily published
mikebronner/laravel-pivot
package on packagist.
- installation of patched laravel-pivot dependency.
- dependency constraints from 5.8 to 5.8.*.
- using
find()
to get multiple items via an array. Thanks @cluebattery !
- functionality for caching of model relationships across different connections and databases. Thanks @PokeGuys for starting the conversation around this problem.
- cache cooldown flush when cool-down seconds option was used.
laravel-pivot
package compatibility temporarily with Laravel 5.8 patch of my own until they provide compatibility.
- version requirements in composer.json.
- Laravel 5.8 compatibility.
- compatibility with previous versions of Laravel, as it was no longer sustainable with all the changes required.
- depency laravel-pivot to next major release version, from a dev-version.
- reference to
request()
helper toapp("request")
for Lumen compatibility. Thanks @PokeGuys
- functionality to invalidate cache after running
increment()
anddecrement()
queries.
- tracking of model table in cache key for those using dynamic table names in models.
- dependency of
laravel-pivot
package to use the new code branch which includes a fix for Laravel Telescope compatibility.
- relationship queries breaking on new where clause type
InRaw
.
- typo in method
checkCooldownAndFlushAfterPersiting()
tocheckCooldownAndFlushAfterPersisting()
; thanks @jacobzlogar!
- handling of
whereJsonContains()
andorWhereJsonContains()
.
- price field value generation in BookFactory to not exceed database field limits.
- use of
cache()
helper method toapp("cache")
to allow for better Lumen compatibility. Thanks @nope7777!
- test script for Laravel 5.7 to use non-dev version of test dependency.
codedungeon/phpunit-result-printer
unit test output printer.
- use of custom pagination name.
- edge-case where tag creation failed.
- usage of
forceDelete()
in the Builder.
- Laravel 5.7 compatibility.
- caching of subqueries of
->whereNotIn()
and->whereIn()
. - nested where bindings.
- where clause binding resolution issue.
- function name typo.
- dump() used for debugging.
- caching of paginated queries with page identifiers as arrays (
?page[size]=1
).
- unit tests for multiple versions of Laravel simultaneously.
- backwards-compatibility to Laravel 5.4.
- caching of queries with
whereNotIn
clauses.
- readme to specify that lazy-loaded relationships are currently not cached.
- caching of queries with
whereIn
clauses.
- database name to cache keys and tags to help with multi-tenancy use-cases.
find()
using array parameter.
- nested
whereNull
withinwhereHas
.
- caching of
between
where clauses. - test cache keys and brought them back to green.
- caching of query parameter bindings.
->inRandomOrder()
to not cache the query.
flush
console command to be calledclear
, to match other laravel commands.
- implementation of
count()
method.
- disabling of
all()
query.
- cache invalidation when
destroy()
ing models.
- cache tag generation when calling
all()
queries that prevented proper cache invalidation.
- caching of
->first()
queries.
- database connection name to cache prefix.
- exception when calling disableCache() when caching is already disabled via config.
- package dependency version to work with Laravel 5.5.
- pagination cache key generation; fixes #85.
- disabling of caching using the query scope.
- actions on belongsToMany relationships not flushing cache when needed.
- additional integration tests for additional use cases.
- flushing a specific model from the command line that extended a base class and did not use the trait directly.
- cache invalidation when using ->insert() method.
- cache invalidation when using ->update() method.
- code with some home-cleaning and refactoring.
- CachedBuilder class with some refactoring and cleanup.
- cache-invalidation-cool-down functionality.
- disabling of
->all()
method caching via config flag.
- config setting to allow disabling of model-caching.
- cache key generation for
find()
andfindOrFail()
.
- caching for
paginate()
;
- implementation tests using redis.
- additional tests for some edge case scenarios.
- cache key prefix functionality.
- tests through refactoring and cleaning up.
- unit test to make sure
Model::all()
returns a collection when only only record is retrieved. - console command to flush entire model-cache.
- hash collision logic to not run query twice if not needed.
- optional cache key prefixing.
- detection of Cachable trait to use
class_uses()
instead of looking for method.
- hash collision detection and prevetion.
- disabling of cache from using session to use cache-key instead.
- the erroneous use of
arrayEmpty()
function, changed to simplecount()
.
- refactor functionality to trait (thanks @rs-sliske!).
- readme spelling errors (thanks @fridzema!).
- whereNotIn query caching.
- whereBetween and value bindings parsing.
- Laravel 5.5 dependencies.
- Laravel 5.6 compatibility.
- previously existing unit tests to properly consider changes made in 0.2.19.
- parsing of where clause operators.
- hashing of cache keys to prevent key length over-run issues.
- dependency version constraint for "pretty test printer".
###Added
- caching for value() querybuilder method.
- tests to use Orchestral Testbench.
thanks
package.
- readme explaining
thanks
package.
- sanity checks for artisan command with feedback as to what needs to be fixed.
- ability to flush cache for a given model via Artisan command.
- ability to define custom cache store in
.env
file.
- chainable method to disable caching of queries.
- functionality to clear corresponding cache tags when model is deleted.
- caching when using
orderByRaw()
.
- test for query scopes.
- test for relationship query.
- readme file.
- travis configuration.
- code with optimizations and refactoring.
- remaining unit tests that were incomplete, thanks everyone who participated!
- added parsing of where
doesnthave()
condition.
- orderBy clause to cache key. Thanks @RobMKR for the PR!
- parsing of nested, exists, raw, and column where clauses.
- .gitignore file to reduce download size for production environment.
- parsing of where clauses with null and notnull.
- parsing of where clauses to account for some edge cases.
- additional unit tests for checking caching of lazy-loaded relationships.
- generation of cache key for queries with where clauses.
- where clause parsing when where clause is empty.
- approach to caching things. Completely rewrote the CachedBuilder class.
- many, many more tests.
- initial development of package.
- unit tests with 100% code coverage.