Code Monkey home page Code Monkey logo

cachequery's People

Contributors

darkghosthunter avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cachequery's Issues

Laravel 6+ and PHP 7.4

Please check these requirements

  • This feature helps everyone using this package
  • It's feasible and maintainable
  • It's non breaking
  • I issued a PR with the implementation (optional)

Description

Dear Author,

This is a package that shines.

Can you please make it compatible with PHP 7.4 and Laravel 6+?

Code sample

PHP 7.4
DB::table('user')->cache(30,'id_123')->get();

[X.x] Add support for cache tags

Please check these requirements

  • This feature helps everyone using this package
  • It's feasible and maintainable
  • It's non breaking
  • I issued a PR with the implementation (optional)

Description

Would it be possible to add support for optionally using cache tags? So we can do things like:

Article::latest('published_at')->with('drafts')->take(5)->cache(key: 'latest_articles' tag: 'tenant_1')->get();

Cache::tags('tenant_1')->flush();

etc.

Code sample

See above :)

[X.x] What does happen that is considered an error or bug?

PHP & Platform

8.1.2

Database

No response

Laravel version

10.x

Have you done this?

  • I have checked my logs and I'm sure is a bug in this package.
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

$this->assertPublishes() should take also the origin file. There is no point of using this method if we can't ensure the origin and destination under a tag.

Description

Above

Reproduction

//

Stack trace & logs

No response

[1.x] Forgetting a key returns Array to String exception

PHP & Platform

8.1.3

Laravel verion

9.17.0

Have you done this?

  • I am willing to share my stack trace and logs
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

Forget key programmatically with Facade

CacheQuery::forget('offer_details_distinct_quadro');

or

with artisan command thrown exception

Description

Array to string exception

Reproduction

$arrayOption = Model::query()->cache(key: 'offer_details_distinct_quadro', ttl: now()->addHour())->distinct()->pluck('name', 'name')

Stack trace & logs

ErrorException 

  Array to string conversion

  at vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:223
    219▕      * @return bool
    220▕      */
    221▕     public function forget($key)
    222▕     {
  ➜ 223▕         return (bool) $this->connection()->del($this->prefix.$key);
    224▕     }
    225▕ 
    226▕     /**
    227▕      * Remove all items from the cache.

      +18 vendor frames

Are you a Patreon supporter?

No, don't give priority to this

[3.0.1] Not working with paginate() method

PHP & Platform

8.0.25, Ubuntu 20.04

Database

PostgreSQL 13

Laravel version

9.37

Have you done this?

  • I have checked my logs and I'm sure is a bug in this package.
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

The cache scope should also works with paginate()

Description

The paginte() method returns TypeError, but if I change it to simplePaginate method all working fine.

Reproduction

$model = Example::query()->cache()->paginate();

Stack trace & logs

{
 "class": "TypeError",
  "message": "Illuminate\\Database\\Query\\Builder::__construct(): Argument #1 ($connection) must be of type Illuminate\\Database\\ConnectionInterface, Laragear\\CacheQuery\\CacheAwareConnectionProxy given, called in /home/mp/htdocs/backend/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php on line 3482"
}

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.