Legacy to Laravel in 30 minutes
summary
A decade‑old multi‑tenant PHP platform gets migrated piece‑by‑piece into Laravel without downtime: six repositories consolidate into a new Laravel app with a legacy folder, a catch‑all route, a legacy exit exception and header helpers to intercept die/redirects. Migration uses Laravel Shift, adds migrations and tests as a safety net, and converts routes until every route runs in Laravel. A table demo shows 100,000 rows in under a second, and developer velocity and stability improve.
AI-written summary · about
chapters (23)
- 0:00Start
- 1:10Jordan’s PHP background, discovering Laravel through flight sim projects and joining Okfolio
- 3:00The asbestos and hazardous materials problem space and what the Okfolio platform does today
- 6:30From modern product back to reality - migrating a decade old multi tenant beast
- 7:00Six repositories, client and common code bases, safety pages, admin app, inspector app and API
- 8:30Inside the legacy PHP: God classes, homemade routing, and JavaScript built as PHP strings
- 10:00No ORM, no DI and static configuration - why “just add tests before you refactor” is not so simple
- 11:40The Lumen 6 API with everything in one controller method
- 13:20Mobile app changes, Friday side quest and using Laravel Shift to convert Lumen to Laravel
- 15:35Choosing gradual conversion and the strangler pattern over a risky big bang rewrite
- 16:20Building the Laravel wrapper: new app, legacy folder, updated client code and a catch all route
- 17:15The legacy controller, output buffering and letting the old app think nothing has changed
- 17:50Replacing die calls with a legacy exit exception so Laravel can catch and return responses
- 18:25Handling raw header redirects via a helper and exception to keep control inside Laravel
- 19:00Iterating daily, drawing from Andrew Morgan’s article and standardising the legacy code
- 20:30Establishing tests as the safety net so the team can refactor and deploy with confidence
- 22:00New rhythm: features built in Laravel, fixes migrated when touching legacy, and the one way door
- 23:00Every route now in Laravel, developer happiness and velocity up
- 24:25Framing the migration for leadership around bugs, firefighting, support and the next decade
- 26:15The slow legacy tables, timeouts and over fetching that hurt the customer experience
- 26:45Laravel table demo: 100,000 rows in under a second, jazzed up UI and immediate buy in
- 27:45Reflecting on “cheating” with Laravel’s tooling, models and pagination to deliver big wins
- 28:30Final advice for teams sitting on legacy code and closing encouragement that the path is possible
related talks
48mMigrating a 15 Year Old Enterprise Application to Laravel: Lessons Learned and Opportunities Gained
49mElevating Legacy: A Case Study on the migration from Laravel 4 to 9
28mMigrating to Laravel: Managing the ick
20mhow to make the management of a league system less traumatic
43mModern Features in a Legacy App via APIs
39mThe State of Laravel
52mFrom Native PHP to Laravel in Production
49mLaravel - If, how and why you should use it!
