cjmellor / level-up

Level-Up is a Laravel package introducing gamification into your applications. Users earn experience points (XP) and levels through interactions, while also unlocking achievements. It promotes engagement, competition, and fun through its dynamic leaderboard feature. Customisable to fit your specific needs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Deduct Points

CharbelEid991 opened this issue · comments

What happened?

User's level is not changing when the points are reduced.
When a user gains certain amount of points the level changes and he will get to a higher level.
However if I deduct points for this user , his experience changes but his level stays the same even tho now it should be lower.

How to reproduce the bug

Add points to a user until he reaches a certain level. Then try to deduct his points. The experience will change however the level will stay the same

Package Version

2

PHP Version

8.2.0

Laravel Version

9.0.0

Which operating systems does with happen with?

macOS, Linux

Notes

No response

Hi,

So this isn't really a bug, more of a design choice. I opted not to lower levels when points were deducted.

I can see why you'd expect that behaviour though.

Honestly, I don't for-see any plans to implement it on my own, so I am open to a PR to implement it.

Thanks.