Once the strangler fig from Part 1 is working, the new Laravel app grows fast. Each migrated route brings a feature with it: dealers, orders, invoices, stock. Teams usually organise that into modules, something like app/Modules/Orders , app/Modules/Billing , app/Modules/Inventory . For a few months it feels clean. Then someone adds a call from Billing into Orders to check a status, someone else adds a call from Orders into Billing to fetch a price, and a year later every module imports every other one. You have rebuilt the legacy ball of mud, only with nicer folders.
I see this pattern often enough that I now add a dependency check before the second module exists. This post shows how to find cycles in an existing modular Laravel app, how to break them without a rewrite, and how to stop them from coming back.
I wrote this with help from AI tools and checked the commands against the deptrac and Laravel documentation.…