Talk in English - US at Longhorn PHP 2026
Track Name:
Hill Country D
Short URL: https://joind.in/talk/c06c4
(QR-Code (opens in new window))
Many business processes begin with a status column and a few if statements. Then exceptions, retries, approvals, and failure paths appear. Before long, the workflow is scattered across controllers, services, queue consumers, scheduled jobs, and database updates, and nobody can say with confidence which transitions are valid or what should happen when something fails.
In this hands-on session, we'll use state machines to make these workflows explicit, predictable, and testable in PHP. Using familiar examples such as orders, payments, withdrawals, onboarding, and identity verification, we'll model each process as a set of states, allowed transitions, guard conditions, and actions rather than relying on loose status strings.
Using a real PHP state machine library, we'll build a workflow live, prevent invalid transitions, centralize the rules that determine what can happen next, and automatically trigger actions when the state changes. We'll also test the workflow logic independently of controllers and infrastructure.
We'll then look at how a state machine fits into a real PHP application, including where the workflow logic should live and how the rest of the application should interact with it.
You'll leave knowing how to recognize when a growing collection of conditionals should become an explicit workflow model and how to implement that model cleanly and testably in PHP.
Comments
Comments are closed.