Menu

1 / 2

How I Built a Multi-Department Workflow Routing System in Laravel with Inertia.js

DEV Community·Chris Lloyd Fallaria·6 months ago
#bkT2dKch
#laravel#php#webdev#table#department
Reading 0:00
15s threshold

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…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.