litermi / cache-query-builder
it is a package provider cache from query generate and purge cache when used methods specifics
Requires
- php: ^7.4|^8.0
- illuminate/config: ^6.9|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/console: ^6.9|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/contracts: ^6.9|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/database: ^6.9|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/http: ^6.9|^7.0|^8.0|^9.0|^10.0|^11.0
- kirschbaum-development/eloquent-power-joins: ^2.5|^2.6|^3.5
- litermi/error-notification: ^1.0
- litermi/logs: ^1.0
- litermi/response: ^1.0
- spatie/laravel-query-builder: ^3.6|^5.0|^5.8
- dev-main
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- dev-feature/BAC-67-add-create-method-to-purge-cache-before-active-record-trait
This package is auto-updated.
Last update: 2025-03-01 00:30:17 UTC
README
About
The cache-query-builder
package allows you to increase the performance and low pressure to database request.
Tutorial how create composer package
Features
- cache query getting columns and values
- cache sub query / relationship
- set time individual by model
- methods to get and first values from cache
- methods to save, insert, delete to cache
Installation
Require the litermi/cache-query-builder
package in your composer.json
and update your dependencies:
composer require litermi/cache-query-builder
Configuration
set provider
'providers' => [ // ... Litermi\Cache\Providers\ServiceProvider::class, ],
The defaults are set in config/cache-query.php
. Publish the config to copy the file to your own config:
php artisan vendor:publish --provider="Litermi\Cache\Providers\ServiceProvider"
Note: this is necessary to you can change default config
Usage
To cache for query you need use extend Class
class Product extends CacheModel { }
To cache for query you need use methods: getFromCache or firstCache
return Product::query() ->where('active', ModelConst::ENABLED) ->with($relations) ->getFromCache(['*'], $tags);
if you want purge cache can use methods: saveWithCache, insertWithCache, deleteWithCache
$product = new Product(); $product->saveWithCache();
Product::insertWithCache($values);
$product->deleteWithCache();
License
Released under the MIT License, see LICENSE.