6

I am in the process of converting a raw PHP site (no framework, no nothing) to Laravel.

We have two approaches here: we either do everything in one shot, or we can try migrating feature by feature.

I would rather do this one shot but it will depend on the timeframe, and we would like to have an option for migrating feature by feature, being able to keep part of the site with its original raw structure, and migrating to Laravel piece by piece.

Is it possible to have both working side by side?

Can we have a subfolder within a Laravel project that is ignored by Laravel and contains the old features, and as we move along, we create new route handlers for each of the features that is being migrated to laravel?

Or should we approach this in a different way?

Miguel Mesquita Alfaiate
  • 2,851
  • 5
  • 30
  • 56
  • 3
    Check out laravel's rewrite rules. Nothing that actually exists in public/ is served by Laravel. Therefore, you can have independent media, html, and php files in that folder. – Devon Bessemer Oct 05 '18 at 13:05
  • 1
    My experience with Laravel is quite small. But answering related to CodeIgniter's experience. What you could do is add a controller for the view you already have, requireing some changes (but would anyway if you want to display the original content as is). And then start picking out the functionality case by case and createing custom controllers for them. This will allow smooth integration as well between the 2 versions. – Martin Oct 05 '18 at 13:06
  • @Devon thanks I will try that out! – Miguel Mesquita Alfaiate Oct 05 '18 at 13:10
  • 1
    This is a very general architectural question in my opinion. Depending on the size of the application I would do it step by step but it creates additional overhead in working time ofc. – Blackbam Oct 05 '18 at 13:12
  • @Blackbam This is not an architectural question. I am not asking whether or not I should approach this as a one shot or iterative development. I am going to develop step by step, hopefully just delivering when it's all done. But always keeping in mind that deadlines might force me to deliver before everything is migrated, and I need to keep that in mind. – Miguel Mesquita Alfaiate Oct 05 '18 at 13:17
  • @BlunT It certainly should be possible to integrate Laravel step-by-step. But if Laravel is the starting point of your application you probably have to use its routing functionalites and therefore put all the other parts of the application into some un-optimized models refactoring all the routes. – Blackbam Oct 05 '18 at 13:25
  • Can you tell us a little more about the routing of the old application? is it index.php?name="oldroute" or something similar? I had to put an old application in /public and use .htaccess to point every request to the files ```except``` index.php to the old application and rest to laravel You can handle that in different ways though... – UnderDog Dec 25 '18 at 20:14

1 Answers1

-4

first you need to create all controller,migration,model and routing in your laravel then step by step you can migrate your project into laravel.