You could consider using event sourcing. Then you can always retrace back, if a user feels they lost credits unjust
https://spatie.be/docs/laravel-event-sourcing/v5/introduction
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone!
I need some suggestions for my app. Here's the deal - when a user is subscribed to a plan he collect his actions that will decrement by 1 every time the user do an action. So for example the user paid for a plan that gives him 50 actions. If he changes his profile picture his actions will lower to 49 and like that till 0 actions where the user gets "middlewared" to a page which cannot be skipped - buy more actions. What will be the best method to store these actions in the database? How should i store them - starting from 0 with increments up to 50 or starting from 50 with decrements to 0? Also can you suggest me how to organize all the processes, for example - create functions that will be called when necessary which functions will increment/decrement the user's credits.
Thanks in advance!
Best Regards, Alex
Please or to participate in this conversation.