Have you considered looking into event sourcing?
https://spatie.be/docs/laravel-event-sourcing/v7/introduction
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
context: I am writing a trading algo. I want to manage transactions and account balances for various trading accounts (and brokerages). The transactions relate to trades and balance changes, fees, starting balances etc.
Poking around on the web for database schemes...
transactions
-document_id // I assume this is for a check or paperwork that's related.
-description
-date
ledger_entries
-transaction_id
-account_id
... amount and so on.
accounts
...
So there isn't a balance stored? And why not combine the ledger and the transactions? What is the best way to manage this? Is there a typical or best practice here?
Have you considered looking into event sourcing?
https://spatie.be/docs/laravel-event-sourcing/v7/introduction
Please or to participate in this conversation.