Comments (4)
Hi,
it seems that this feature is currently not implemented.
I assume you mean something like forgetAll()
or something like that.
Idea / Workaround:
- get all models ( code snippet: http://stackoverflow.com/a/34054171 )
- Initialize an empty model for each found model
- Run the
forgetCache()
method for each initalized model
from laravel-cacheable.
I hope i understood it correctly.
You have a model where the cacheable package is used.
You have a static variable where you can exclude a function from the cache:
protected $ignoreCache = ['created', 'updated'];
Is this correct?
Maybe, it's better to create a new issue / feature request for this.
If you have any ideas how to implement this, feel free to send a PR :)
from laravel-cacheable.
Ok. I will try.
Also, will be great to set if you want to use cache or not for some functions, and when ends, recache.
Thanks!
from laravel-cacheable.
@Krato For the first question about forgetting all models cache, I don't see a real need to implement it by default since you still can do it as @noxify mentioned, and it's actually up to your app's logic which differs from one scenario to another 🙂
And for the other feature request about ignoring some methods, that's a good idea. I'll be happy to accept your PR, or you can open a new issue with your feature proposal 👍
from laravel-cacheable.
Related Issues (15)
- Update to Laravel 5.5 HOT 3
- data folder inside framework/cache/ not created after cache:clear HOT 2
- Set cache driver and cache lifetime HOT 2
- getCacheLifetime return type error HOT 1
- Cannot install on LV5.5 and PHP 7.1 HOT 2
- Overriding $cacheLifetime HOT 1
- laravel 5.5: Your requirements could not be resolved to an installable set of packages. HOT 1
- Doesn't work with factories HOT 1
- Test ticket from Code Climate
- fire function is removed HOT 1
- Event::fire has been removed. HOT 2
- Cached relations are not invalidated HOT 4
- How to disable cache for RAND() HOT 1
- Question: Should work on PHP 5.6 ? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-cacheable.