Git Product home page Git Product logo

Comments (6)

Omranic avatar Omranic commented on August 19, 2024 1

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.

sarfraznawaz2005 avatar sarfraznawaz2005 commented on August 19, 2024

@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.

Omranic avatar Omranic commented on August 19, 2024

Oh, let me check that now..

from laravel-cacheable.

sarfraznawaz2005 avatar sarfraznawaz2005 commented on August 19, 2024

@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.

sarfraznawaz2005 avatar sarfraznawaz2005 commented on August 19, 2024

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.

sarfraznawaz2005 avatar sarfraznawaz2005 commented on August 19, 2024

Thanks again for the nice package 😄

from laravel-cacheable.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.