spatie

Laravel Event Sourcing (Spatie) - Using projections within business rules

萝らか妹 提交于 2019-12-10 12:04:21
问题 I know that the general concept behind event sourcing is that the state of the application should be able to be replayed from the event stream. Sometimes, however, we need to get information for business rules from other parts of the system. i.e. An account has a user. A user has a blacklist status which is required to check if they can access/edit the account. In the below example (purely for demonstration purposes), a user tries to subtract $10 from their account. If a user has been