Mar 3, 2026
MyTHSP is the compliance platform that THSP's consultants and clients rely on every working day. It has 27 integrated modules, more than 200,000 lines of code and a database of over 320 tables. Consultants use it in the field to complete fire risk assessments, COSHH assessments, inspections and more, then generate the reports their clients hand to insurers and inspectors.
It is also a custom PHP application, built on its own custom foundations (including a home-grown database layer) rather than a modern, widely supported framework. That served THSP well for years. But custom frameworks get harder to maintain, harder to secure and harder to hire for as time goes on. So the platform is moving to Laravel, the most widely used PHP framework.
The interesting question was never whether to modernise. It was how to do it without switching off a system the business cannot live without. The answer is an approach called the Strangler Fig pattern.
The obvious option is the big-bang rewrite: build a brand new system alongside the old one, then switch over on launch day. It sounds clean. In practice it is one of the riskiest things a business can do with its software.
Everything stops: while the new system is being built, the old one is effectively frozen. New features and improvements wait months, sometimes years.
Hidden rules get lost: a mature platform is full of business rules that nobody ever wrote down. A rewrite has to rediscover every one of them, and the ones it misses tend to surface on launch day.
All the risk lands at once: if something goes wrong at switchover, it goes wrong for every user, across every module, at the same time.
You pay twice before you see anything: the business funds the old system and the new one in parallel, with no return until the very end.
For a platform the size of MyTHSP, that is not a gamble I would recommend to any client.
The name comes from a type of fig tree. Its seed lands high in the branches of a host tree and sends roots down to the ground. Over time the fig grows around the host, gradually taking over, until it can stand on its own. The changeover happens slowly, and at no point is there a gap where nothing is standing.
In software, the idea is the same. Rather than replacing the old system in one go, you grow the new system around it. Each piece of functionality moves across one at a time. The old code keeps running everything that has not moved yet, and is retired piece by piece as its replacement proves itself.
The name was coined by software author Martin Fowler, after he saw strangler figs in the Queensland rainforest in 2001. His original write-up of the Strangler Fig Application is still the best short introduction to the idea.
On MyTHSP, the legacy code and the new Laravel code live side by side in the same project. Users still visit the same web address, log in the same way and see the same platform. Behind the scenes, every request is checked on the way in.
If that page or feature has already been moved to Laravel, Laravel handles it. If it has not, the request is passed to the legacy code, which deals with it exactly as it always has. From the user's point of view there is one system. They have no reason to know, or care, which part of it answered.
Because both sides work from the same database, there is no data migration to schedule and no risk of the two drifting apart. A record saved by a Laravel page is immediately visible to a legacy one, and the other way round.
Then the work proceeds one route, one feature, at a time. Once a section is running in Laravel and has proven itself in real use, the legacy code that used to handle it is deleted. Bit by bit, the old system shrinks and the new one grows.
Each move follows the same careful routine:
Understand what the old code really does, including its quirks. Matching what it actually does matters more than matching what the documentation says it should do.
Write tests that capture that behaviour, so the new version can be checked against it rather than against someone's memory.
Build the Laravel version, with tests and documentation as part of the job, not an afterthought.
Switch the route over using the same automated deployment process that already ships MyTHSP updates in about 30 seconds.
Watch it closely. The error logging overhaul I did earlier on the platform means genuine problems show up clearly instead of hiding in noise.
Roll back if needed. If anything looks wrong, that feature goes straight back to the legacy code while it is fixed. Nobody is left stranded.
Because each change is small, any problem is small too, and it affects one area of the platform rather than all of it.
The biggest benefit is that the business never has to stop. Bug fixes, improvements and new features carry on throughout. Better still, new features can be built in Laravel from the start, so every new piece of work moves the platform forward rather than adding to the old code.
It also changes the shape of the cost. Instead of one large, open-ended project with nothing to show until the end, modernisation becomes a steady programme of small, scoped pieces of work. Each one delivers something on its own. The pace can be stepped up when there is budget and slowed down when there is not, without leaving the platform half-broken.
And there is no launch day to dread. Consultants in the field simply keep working, while the platform underneath them quietly gets more modern, more secure and easier to maintain.
To be fair to the alternative, the Strangler Fig is not a shortcut. For a period, the platform contains two styles of code, and keeping that tidy takes discipline. The real risk with this approach is not a dramatic failure, it is losing momentum and ending up permanently half-migrated. That is why each step finishes with the old code being removed, not just bypassed.
The destination is a modern Laravel codebase with test coverage, proper documentation and no vendor lock-in. Any competent Laravel developer can pick it up, which matters for a business that depends on its platform for the long term. Security updates, hosting and future development all become simpler, because the platform sits on a framework with a huge community behind it rather than one that only a handful of people have ever seen.
Most importantly, THSP get there without a single day where the business had to stop and hope.
If you want the technical detail behind the approach, these are the articles I would point a developer to:
Strangler Fig Application, Martin Fowler. Where the name and the idea come from.
Patterns of Legacy Displacement, Ian Cartwright, Rob Horn and James Lewis on martinfowler.com. A deeper look at the techniques for replacing a legacy system piece by piece.
Strangler Fig pattern, Microsoft Azure Architecture Center. A clear diagram of the routing layer that sends each request to the old or new system.
Strangler fig pattern, AWS Prescriptive Guidance. A step-by-step walkthrough, including when the pattern is not a good fit.
Refactoring Legacy Code with the Strangler Fig Pattern, Shopify Engineering. How Shopify used it to untangle code in a large, live production application.
If your business depends on a PHP system that is getting harder to change, a rewrite from scratch is rarely the right first move. I start every modernisation with a fixed-price Platform Audit, so we both know exactly what is there before anything is quoted. From there, the Modernise service moves it to Laravel in stages, the same way I am doing for MyTHSP.
You can read more about the platform itself in what I built for THSP, or get in touch directly. No jargon, no pressure.
The fixed-price Platform Audit reviews your code, security and server, and gives you a plain-English report with a prioritised, costed action plan. £1,950, within two weeks.
A look inside MyTHSP, a custom PHP SaaS platform with 27 integrated compliance modules, built for one of the UK's leading health and safety consultancies.