I want to migrate a very old-fashioned PHP app gradually to Laravel. The application does not yet use a general entry point, but uses direct file URLs to work. So, in order to gradually move over functionality, I would like to check first in my routes whether the url exists as a physical file on the server. If that is the case, execute that file. If not, go through the laravel routes.
I have been looking into both the excellent 'Legacy to Laravel' blogpost by Tighten and an older article on PHPArch 'Migrating Legacy Web apps to Laravel'. They both assume there is one front-end controller, which isn't the case in my application.
What would be the cleanest way of implementing this in Laravel 11?
.phpfiles to your Laravel application'spublicfolder. Then, once you've implemented the functionality, replace the content of the.phpfile with a simple<?php header('Location: http://your-site/laravel/route');, so navigating directly to that.phpURL would redirect you to the proper Laravel-handled page. That's how I've had to handle legacy app to new app, but that was only for 1 or 2 URLs that people had bookmarked; might not be a great solution if you have a ton of.phpfiles, and it feels a little "hacky" anyway.