The Problem I Was Trying to Solve
When I started building VMMS — a voucher management system
for government offices — one of the hardest parts wasn't
the UI or the database schema.
It was the workflow routing.
A voucher request doesn't just go to one office. It goes
to multiple departments in a specific order — each one
needs to process it before passing it to the next.
And at any point, a department can:
Complete their step and pass it forward
Reject the entire request
Flag it for missing documents and pause processing
I needed a system that could handle all of that cleanly.
How I Modeled It
Every voucher type has a configurable processing flow
stored in a transaction_flows table:
Schema :: create ( 'transaction_flows' , function ( Blueprint $table ) { $table -> id (); $table -> foreignId ( 'voucher_id' ) -> constrained () -> cascadeOnDelete (); $table -> string ( 'department' ); $table -> integer ( 'order_number' ); $table -> timestamps (); });
Enter fullscreen mode
Exit fullscreen…