Upgrade laravel 3 to 5

790 Views Asked by At

I want to upgrade laravel version from 3.1 to 5.x. What steps I need to follow to do this?

Approach I found based on research is

  1. Moving 3 to 4 first and then from 4 to 5.
  2. Fresh installation of laravel 5 and change my code accordingly.
2

There are 2 best solutions below

2
Loek On

The laravel docs give pretty good guides on how to upgrade (you first have to upgrade to 4, then to 5).

But since Laravel 5 is so different in every way, I wouldn't be surprised it's actually faster just to rewrite everything. At the very least it's safer and more optimized!

0
serdar.sanri On

There is no easy way to upgrade Laravel 3 to any other Laravels. There are quite a bit bottle-necks there 1. Laravel 3 is based on Symphony2 and mostly influenced from Sphinx, on the other hand laravel4-5 is based on Symphony3. 2. Core Laravel3 is build on base level, so everything you build in your application folder builds up on top of Laravel instance, but Laravel4 and 5 are a composer package. So basically you are using these packages along with others to build your system. 3. Laravel3 has bundles and Laravel 4-5 has packages. Bundles has been deprecated quite long time ago and most of them are not being maintained anymore. Building process and structure is totally different than packages work. and this list goes on and on.

Like I mentioned at the beginning there is easy way for it. By easy I meant running a script and everything is brand new.

From views to application, to schemas and Eloquent, many coding style and structure is changed in Laravel4. So long story short, there is no upgrade documentation for 3 to others because the only way to upgrade is rebuilding the application with new way. Even if you find a script to automate most of your code conversions, you still need to go through bundles and find right packages, add them to your composer and find old usages of them in your code to replace with new way.