@digital-pig I’ve worked on a few modernisation projects like this in the past, and these are the steps I took:
- Create a brand new Laravel project.
- Rename public/index.php to public/laravel-index.php, and update the Apache/nginx configuration appropriately.
- Dumped the legacy application‘s files in the public directory.
So now, when a request comes in, your server will use the existing script if it exists, or fall back to trying to pass the request through Laravel’s front controller (public/laravel-index.php). Initially, all requests will be handled by your “legacy” code as before. You can now start re-factoring the legacy app’s scripts into models, controllers, etc.
As you chip away, the number of files in your public directory will reduce, and the number of nice Laravel controllers and models you have will increase. When you’ve finally re-factored everything to Laravel, you can rename your public/laravel-index.php front controller back to just public/index.php, and you’re left with a modern Laravel application.
It’s also a good idea to add tests as you’re going if you don’t have any already.