Giter Club home page Giter Club logo

Comments (22)

mikebronner avatar mikebronner commented on July 29, 2024 1

I will take a look at this, thanks!

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@jurrid Thanks for reporting. I will look into this ASAP. :)

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Looking into this now.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Fix is implemented in next patch, coming in a few minutes.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Should be fixed in version 0.2.35. Please let me know if it works for you now. Thanks! :)

from laravel-model-caching.

jurrid avatar jurrid commented on July 29, 2024

There is one little issue now.
The extra query is now cached but the pagination buttons are not working.

{{ $articles->links() }}

If you click to the second page the offset in the next page is stuck on the one thats is cached.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Hmm, thanks for following up with me. I'll look into this.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Hi @jurrid, I added some pagination tests, and the links provided seem all correct to me. Any chance you customized your pagination somehow, or are passing in parameters to the pagination command?
Take a look at the tests I added here (31c0b12) and let me know if I missed something?

Thanks!

from laravel-model-caching.

 avatar commented on July 29, 2024

I have the same issue with pagination.

Clicking buttons redirects for example to my-route?page=5, but data is still from page=1.

Cache server: redis
Laravel: 5.5
PHP: 7.1

Pagination is broken since [0.2.35]

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

I will try to have another look at this. @dyzajash Could you post the query you use to paginate this?

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

I have been able to reproduce this issue now. Working on identifying the cause and then a fix, hopefully today.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

This is now fixed in release 0.2.45. Please let me know how it works for you guys. Thanks for being patient and reporting it!

from laravel-model-caching.

 avatar commented on July 29, 2024

0.2.45 is not working with Laravel 5.5

    - Installation request for genealabs/laravel-model-caching ^0.2.45 -> satisfiable by genealabs/laravel-model-caching[0.2.45].
    - genealabs/laravel-model-caching 0.2.45 requires fico7489/laravel-pivot ^2.2 -> satisfiable by fico7489/laravel-pivot[2.2.4, 2.2.5].
    - fico7489/laravel-pivot 2.2.4 requires illuminate/database 5.6.* -> satisfiable by illuminate/database[v5.6.0, v5.6.1, v5.6.2, v5.6.3, v5.6.4, v5.6.5, v5.6.6, v5.6.7].
    - fico7489/laravel-pivot 2.2.5 requires illuminate/database 5.6.* -> satisfiable by illuminate/database[v5.6.0, v5.6.1, v5.6.2, v5.6.3, v5.6.4, v5.6.5, v5.6.6, v5.6.7].

So I can't even check.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Ack! Will get that fixed. Thanks for alerting me.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@dyzajash This should now be fixed in version 0.2.46.

from laravel-model-caching.

scottgrayson avatar scottgrayson commented on July 29, 2024

@mikebronner 0.2.46 worked for me 👍

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@scottgrayson woot! Thanks for verifying! :) @dyzajash Please re-open if this still doesn't work for you.

from laravel-model-caching.

niladam avatar niladam commented on July 29, 2024

@mikebronner in 0.2.55 this is still an issue and pagination still doesn't work.

This is my code:

    public function index()
    {
        $model = Mymodel::paginate('', ['*'], 'pages');

        return view('model.show', ['model' => $model]);
    }

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@niladam I believe your pagination syntax is incorrect? This is the paginate() method signature:

public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null)

from laravel-model-caching.

niladam avatar niladam commented on July 29, 2024

@mikebronner The pagination isn't incorrect and it doesn't really matter if i use Mymodel::paginate(); my code. The code i was using was Mymodel::paginate('20', [*], 'pagename'); because i'm actually overriding $perPage and $pageName :)

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@niladam thanks, that makes more sense ... in the example above you left perPage as an empty string. I will test again, but didn't have any issues when I tested last weekend. I'll get back to you this weekend. :)

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@niladam I'm sorry, I cannot replicate the issue based on the information you provided so far. If this persists, please open a new issue and make sure to add a complete stack trace along with the eloquent query that broke it.

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.