Menu

1 / 2

How to Build a Multi-Department Approval Workflow in Laravel

DEV Community·Chris Lloyd Fallaria·6 months ago
#FAq7LBRh
#laravel#php#webdev#tutorial#voucher
Reading 0:00
15s threshold

Introduction

One of the most common problems I saw while building VMMS was this: documents get created, emailed to the next department, sit in someone's inbox for days, and when management asks "where's that voucher?" — nobody knows.

In this article I'll walk you through how I built a flexible multi-department approval workflow in Laravel that solves exactly this problem.

The Core Concept

Instead of hardcoding approval steps, I built a pipeline where each document has a current stage, and the next stage is determined by a department configuration stored in the database — not in the code.

This means you can add, remove, or reorder departments without touching a single line of PHP.

Database Structure

Here are the key tables:

// vouchers table Schema :: create ( 'vouchers' , function ( Blueprint $table ) { $table -> id (); $table -> string ( 'title' ); $table -> foreignId ( 'current_department_id' ) -> constrained ( 'departments' ); $table -> enum ( 'status' , [ 'ongoing' , 'accomplished' , 'rejected'…

Continue reading — create a free account

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