Comments (22)
I will take a look at this, thanks!
from laravel-model-caching.
@jurrid Thanks for reporting. I will look into this ASAP. :)
from laravel-model-caching.
Looking into this now.
from laravel-model-caching.
Fix is implemented in next patch, coming in a few minutes.
from laravel-model-caching.
Should be fixed in version 0.2.35. Please let me know if it works for you now. Thanks! :)
from laravel-model-caching.
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.
Hmm, thanks for following up with me. I'll look into this.
from laravel-model-caching.
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.
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.
I will try to have another look at this. @dyzajash Could you post the query you use to paginate this?
from laravel-model-caching.
I have been able to reproduce this issue now. Working on identifying the cause and then a fix, hopefully today.
from laravel-model-caching.
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.
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.
Ack! Will get that fixed. Thanks for alerting me.
from laravel-model-caching.
@dyzajash This should now be fixed in version 0.2.46.
from laravel-model-caching.
@mikebronner 0.2.46 worked for me 👍
from laravel-model-caching.
@scottgrayson woot! Thanks for verifying! :) @dyzajash Please re-open if this still doesn't work for you.
from laravel-model-caching.
@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.
@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.
@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.
@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.
@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)
- What is cacheCooldownSecounds definition? HOT 1
- Add support for Laravel 10 HOT 2
- Object of class Illuminate\\Database\\Query\\Expression could not be converted to string HOT 6
- Since 0.12.4 I get error "GeneaLabs\LaravelModelCaching\CacheKey::processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|string, null given, called in ...\vendor\genealabs\laravel-model-caching\src\CacheKey.php on line 409" HOT 23
- Cannot access "parent" when current class scope has no parent HOT 1
- Laravel v10.3.0 breaks LaravelModelCaching HOT 2
- checkCooldownAndFlushAfterPersisting(): Argument #2 ($relationship) must be of type string, array given, called in /var/www/html/vendor/genealabs/laravel-model-caching/src/Traits/ModelCaching.php on line 83 HOT 8
- Is table join supported? HOT 7
- The attribute [column3] either does not exist or was not retrieved for model HOT 1
- Stale cached value returned where(...)->first() HOT 4
- Fix for GeneaLabs\LaravelModelCaching\CacheKey::processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|string, null given
- processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|Illuminate\Database\Query\Expression|string, null given HOT 2
- Conflict with Spatie Schemaless
- Laravel 11 upgrade blocked by laravel-pivot-events dependency HOT 1
- Missing import in CachedBuilder?
- Fix failing tests HOT 1
- Uuid fromBytes throwing a error HOT 1
- Observer for Pivot Model not firing HOT 3
- Bug: CacheKey::getValuesFromBindings(): Return value must be of type string, null returned | when where value is null HOT 1
- Object of class Illuminate\Database\Query\Expression could not be converted to string
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-model-caching.