← All cases

From plain PHP to Laravel, with tests

Migrating an occupational-health system from plain PHP on Apache to Laravel 12 with Octane, Redis and Horizon, and adding the test suite it never had.

Role
Lead on the migration
Stack
PHP, Laravel 12, Octane, Redis, Horizon, Pest, Docker
Year
2026
Built at
Prontomed

Context

SOL Solução Ocupacional runs an occupational health and safety platform: it holds workplace health data, produces the PGR (Brazil’s mandatory risk management program) and sends events to eSocial, the government’s labour reporting system, through TecnoSpeed. It ran on plain PHP over Apache, with no framework and no automated tests.

The problem

Without a framework, every part of the system handled routing, validation, data access and scheduled tasks its own way. Queries were unstable, every change was risky, and a business goal was hard to reach: spinning up new instances of the product to sell it to other clients.

The approach

I am converting every feature and screen to Laravel 12:

  • Octane keeps the application loaded in memory between requests.
  • Redis + Horizon take over queues and jobs instead of loose cron routines, with monitoring.
  • Pest in Docker covers what gets migrated with automated tests, the base for a CI pipeline that is being built.
  • TecnoSpeed remains the bridge to eSocial.
Architecture before and after the migrationBefore: browser talking to plain PHP scripts on Apache, a database and cron routines. After: browser talking to Laravel 12 on Octane, which uses the database, Redis queues processed by Horizon, sends eSocial events through TecnoSpeed and is covered by Pest tests in Docker.BeforeAfterBrowserPlain PHP + ApacheDatabaseCron routinesBrowserLaravel 12 + OctaneRedis + HorizonTecnoSpeed → eSocialDatabasePest in Docker
Before and after: from PHP scripts with cron to Laravel orchestrating queues, tests and integrations.

Why Laravel

Practicality and orchestration. Laravel ships the components this system needs in one consistent shape: queues, cache, scheduling, authentication and testing. With everything following the same conventions the system scales better, and a new instance for another client becomes configuration, not a rewrite.

Results so far

The migration is ongoing. In the parts already migrated:

  • queries are stable;
  • the user experience is clearly better;
  • the code now has automated tests, where there were none before.