Skip to content
Brian Jiménez Landa
Document-control module for a Laravel ERP, completed in Feb 2026

Every controlled document tracked from draft to obsolete, inside a Laravel ERP

I built the document-control module of a company's Laravel ERP, for its ISO-based management system. Each procedure or form needs a reviewer's and an approver's sign-off, then publishes itself on its target date and lands on the master list.

The problem

The company runs an ISO-based management system. Each procedure and form has to be reviewed and approved before it takes effect, and the company keeps a master list of every controlled document with a record of each change. Its Laravel ERP already stored documents by area. Nothing tracked a document's state or warned the reviewer before a publication date, and there was no export for the master list or the change record.

What I built

  • A workflow with 7 states: draft, in review, in approval, approved, in force, obsolete and cancelled. Each document has an author, a reviewer and an approver. Every review or approval decision is saved with the document version, the person and a comment, and a rejected document goes back with its reason.
  • Separate admin and user dashboards. A user sees what is waiting for their review or approval in filtered tabs. A read-only role can browse published documents without editing anything.
  • Access set per document: open to everyone, limited to its area, or confidential to named people. A separate switch blocks downloads. Documents open in an embedded PDF.js viewer with a watermark.
  • Scheduled publication. A document goes live on its target date and every user gets a notice. The people assigned to it get reminders 3 business days and 1 business day before, on the day, and once it is overdue, in the app and by email.
  • The master list exports to Excel on the company's own form, with the active filters and the generation date. Each document's change-control record exports to PDF.
  • Uploads take PDF and Office files up to 10 MB, and a file is required. Admins can cancel a submission with a reason. Before go-live I added a command that clears test data and a Docker setup for PHP, MySQL and phpMyAdmin.
  • I wrote the deployment guide and the admin and user guides.

How it works

The module runs inside the company's existing Laravel 11 ERP on PHP 8.2 and MySQL 8, next to its purchasing and billing modules. I extended the existing document tables with 18 migrations instead of rebuilding them.

Roles come from spatie/laravel-permission, which the ERP already used. A model observer copies ERP users into the module's own user table when they are created, changed or deleted, so admins don't keep two user lists by hand.

Two scheduled Artisan commands run every morning: publication at 9:00 and reminders at 9:30. The reminder milestones count business days and skip weekends.

Notifications live in their own table and also go out through Laravel Mail with a Blade template. While we tested, an allow-list of addresses kept test emails away from real staff. An empty list switches it to production.

The change-control PDF is a Blade view rendered with Dompdf. The master list opens the company's Excel template with PhpSpreadsheet and fills it, so the file keeps the format the company already used.

The interface is server-rendered Blade with Bootstrap 5. The PDF viewer is PDF.js with a watermark script I added to it.

Results

75 of 78
commits in the module's repository are mine (96%)
7
document states, from draft to obsolete
18
migrations that extended the ERP's existing tables in place
4
reminders per document, counted in business days

Who else worked on it

The ERP, with its purchasing and billing modules, was already in the repository when my commits start. So was a first version of the document screens for areas, users, categories and reviews. I don't claim either here. Three of the 78 commits came from a shared root account on the server, among them the signed-URL fix for the PDF viewer. I can't confirm who made them, so I don't count them as mine. The Excel master-list form belongs to the company.

Full stack

PHP 8.2, Laravel 11, MySQL 8, Blade, Bootstrap 5, Tailwind CSS 4, Vite, spatie/laravel-permission, Laravel Scheduler (Artisan commands), Laravel Mail, Dompdf (barryvdh/laravel-dompdf), PhpSpreadsheet, PDF.js, Docker Compose, phpMyAdmin