Event Sourcing is an architectural pattern where instead of storing the current state of an entity, you store the sequence of events that led to that state. The current state is always derived by replaying the events. Combined with CQRS it gives you a complete audit trail, time-travel debugging, and the ability to create new read models from historical data. I show the core concepts with PHP implementation and connect them to CQRS.

(more…)

A custom shipping carrier in Magento 2 goes beyond just returning rates – full implementations include package tracking, label generation, and webhook handling for status updates. I show the complete implementation from collectRates through tracking requests to PDF label generation, using a fictional carrier API to demonstrate all the integration points.

(more…)

PHP 8.4 RC is out and the final release is coming in November 2024. Property hooks looked great on paper – after a month with RC builds on real code I can report what works exactly as expected, where the syntax surprises you, and what limitations matter in practice. Asymmetric visibility also has a few edge cases worth knowing before the feature goes stable.

(more…)

Memento is a behavioural pattern that captures and restores an object’s internal state without violating encapsulation. It is the foundation of undo/redo, version history, and audit logs. I show the classic GoF implementation, a practical price history tracker for Magento, and a database-persisted version that doubles as an audit log.

(more…)

TOP