Giter Club home page Giter Club logo

Comments (12)

bastian-schur avatar bastian-schur commented on July 29, 2024 1

@mikebronner: I just wanted to say that the problem in the current version 0.2.47 no longer occurs. Apparently, various changes have eliminated the problem.
Thanks for the active development!

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@bastian-schur Thanks for reporting. I will look into that ASAP. (Might have to wait until later today, but will be today for sure.)

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@bastian-schur I have not been able to replicate this. I tried the following query on different models, and they returned multiple results:

Model::all()->count();

Could you clear your cache and try again? Are you running a query on the same model before this one that returns only one result? (I'm wondering if perhaps the package is not creating the correct cache keys, or re-using on old cache key when running all().)

If you can provide some more information, that would help a lot! :)

from laravel-model-caching.

bastian-schur avatar bastian-schur commented on July 29, 2024

@mikebronner This problem only occurs if in your database table is only ONE(!) entry! In this case you get the same result like find or first - the requestet model itself. But all or get should return everytime a collection, also there is only one item.
I tryed this with the fallowing steps:

  1. Enable Caching, run dd(Model::all()) -> You receive the Model
  2. Disable Caching, run dd(Model::all()) -> You receive a collection with one Model

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Ah! Thank you for expanding on the issue. I will check that.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Hi @bastian-schur, I was unable to recreate the issue. I implemented an integration test with only one record in the database, and it consistently returns a collection as intended. Can you provide a test repo using a fresh laravel install that reproduces this issue? Thanks!

from laravel-model-caching.

bastian-schur avatar bastian-schur commented on July 29, 2024

@mikebronner I will try it soon, but today i think i will get no time for this. In a short test i tryed it with extending my model directly from eloquent/model, so the modifications in my basemodel will have no influence. I also tryed it with laravel 5.6 but it takes no effect: same result.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Hi @bastian-schur, could you try again using release 0.2.34? I have gone through and done some refactoring and quite a bit of cleanup. Please let me know how that works for you. :)

from laravel-model-caching.

bastian-schur avatar bastian-schur commented on July 29, 2024

@mikebronner thanks for your feedback. Unfortunately, there is no change with the problem.
I look forward to analyze the problem with a fresh laravel installation soon.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@bastian-schur Thank you, please let me know your results, as I have been unable to replicate the issue so far.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@bastian-schur closing this for now, please let me know if you continue to have this problem.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Thanks for following up! :) Glad its working as intended. :)

from laravel-model-caching.

Related Issues (20)

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.