Comments (6)
Thank you @sarfraznawaz2005, honestly since PHP 5.6 already out of date and no longer actively maintained, we're not going to support it. But you still can fork the package, and add the following lines to your composer.json
to use your copy of the package, but you still have to sync any update manually:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/username/repo"
}
],
Hope you can upgrade to PHP7 soon to get benefit of all the awesome stuff 😉
from laravel-cacheable.
@Omranic I understand, just wanted to use this nice package in my existing projects to provide caching layer but yes for future projects I am going to use PHP7 😄
I tried doing the way you mentioned and added CacheableEloquent
in my model, also removed PHP7 string
type hints and any return types from CacheableEloquent
but it said:
PHP Strict Standards: Static function 'updated' should not be abstract
So I removed the static
keyword from the updated
, created
and deleted
functions in CacheableEloquent
and errors were gone but query was not getting cached and no rinvex.cacheable.json
file was generated in cache folder.
Here is the query:
$query = Task::where('user_id', auth()->user()->id)->get();
Could it be that I removed static
keyword ? Any ideas of how to get this working ?
Thanks
from laravel-cacheable.
Oh, let me check that now..
from laravel-cacheable.
@Omranic : Actually I have custom base model which extends Ardent
: (https://github.com/laravel-ardent/ardent)
CoreModel extends Ardent
and Ardent
actually extends Model
:
Ardent extends Model
The Model
already has those updated
, created
and deleted
implementations as you know. So CacheableEloquent
should work even if I am extending Ardent
or some other like Esensi
? But it seems it is not working with any of these packages, only when I directly extend Model
, it works. Any Ideas please ?
from laravel-cacheable.
Figured it out, below code in Ardent was creating the problem:
public function newQueryWithoutScopes()
{
$builder = new Builder($this->newBaseQueryBuilder());
$builder->throwOnFind = static::$throwOnFind;
return $builder->setModel($this)->with($this->with);
}
from laravel-cacheable.
Thanks again for the nice package 😄
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
- Forget cache all models HOT 4
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.