Comments (7)
So i have excluded LadaCacheTrait from UserInfo and it started working again. But now this Model doesn't get cached.
from lada-cache.
If you want to exclude certain tables, please do so using the provided configuration option: https://github.com/spiritix/lada-cache/blob/master/config/lada-cache.php#L76
The trait should always be included in all models, otherwise it might result in bugs.
Regarding the issue you mentioned initially, was the data actually updated in the database? Is the proper data returned once you truncated the cache?
from lada-cache.
i included the Trait again, but whenever i update the field, the cache didnt get refreshed.
it starts like this:
$user->user_info()->first_name = test1
i update like this:
$user_info = $user->user_info()->updateOrCreate(['user_id' => 1], [
'first_name' => 'test2'
]);
When i now echo $user->user_info()->first_name it still says test1, and in the database i have test2. So it got updated all fine, but not in the cache.
I have now included in the config:
'exclude-tables' => ['user_infos'],
and now it works. But i guess it should not be like this ;)
from lada-cache.
No, it should not be like this :) For further debugging I would need to see the output of the Debugbar, specifically of the Queries tab and the Lada tab.
from lada-cache.
For some odd reason it started acting normal again. If it happens again, i report here. How can i share the debugbar info with you?
from lada-cache.
All right, feel free to re-open this in case it happens again. You can send me the screenshots via email or post a link here.
from lada-cache.
@spiritix , another one,
I have 2 models:
- User
class User extends Authenticatable
{
// ...
use \Spiritix\LadaCache\Database\LadaCacheTrait;
public function notifications()
{
return $this->hasMany(Notification::class);
}
// ...
}
- Notification
class Notification extends Model
{
use \Spiritix\LadaCache\Database\LadaCacheTrait;
// ...
public function user()
{
return $this->belongsTo(User::class);
}
// ...
}
For testing i used this code:
foreach(auth()->user()->notifications as $notification){
if(!$notification->read_at){
echo $notification->id.'<br />';
}
if($notification->id==2203){
$notification->read_at = Carbon::now();
$notification->save();
}
}
But Cache is not getting updated. I keep getting notification id 2203.
from lada-cache.
Related Issues (20)
- Support for Laravel 8 HOT 2
- PHP 8.0 error call_user_func_array 🐛 HOT 1
- Laravel 6 and lada-cache 4.0.2 problem HOT 3
- Too few arguments HOT 5
- withCount Issue HOT 4
- Spatie permission used with Lada-cache HOT 1
- Use many unions and use paginate errors HOT 1
- Question regarding this library HOT 1
- Error when using whereHas with BelongsToMany
- I use 2 website setup lada-cache ( different prefix ) connect one redis. But when I delete one row in one website, redis cache empty. I use version 2.1 HOT 2
- "exclude-tables" configuration not working and throwing error HOT 1
- auto-clear cache failure in production HOT 2
- Broken invalidation for joinSub() queries
- Lada breaks Laravel Telescope HOT 11
- Add support for Lumen HOT 3
- How to load service provider during unit tests? HOT 2
- Class lada.handler does not exist HOT 4
- cleanBindings() must be of the type array, null given, whereHas > whereIn() issue? HOT 4
- Doesn't work with spatie / laravel-permission HOT 6
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 lada-cache.