4

I've got a webpage written in L3 and I feel that it's on time to move it forward to L4. So I'm searching for a howto-guide telling me the porting process. In which folders my old files belonges now into and which parts of code have to be rewritten, syntax changes and so on.

Hexodus
  • 12,361
  • 6
  • 53
  • 72

2 Answers2

7

James Gordon wrote a nice blog post detailing the various sections that would need to be changed.

Upgrading from Laravel 3 to Laravel 4

It took roughly three full days of effort (lets call that 24 hours) to convert the application from Laravel 3 to Laravel 4. Not including app/config, app/lang, app/tests or any other Laravel code that exists in the project structure, both projects consisted of a little over 2,500 lines of code. The exact line counts for the original project are as follows:

Folder LOC controllers 540 helpers 183 models 927 tasks 384 views 476 Total 2,510

ralphowino
  • 529
  • 6
  • 19
3

Official changelog should help you.

Also don't forget to change your method names. All snake_case method names are converted to camelCase.

Edit: folder names are almost same. application folder became app, model, view and controllers' folders' paths are still same under the app folder. Migrations are now in app/database/migrations folder.

Routing has changed a bit. the :num, :all etc is dropped, now you can name them anything, and set their rules with regex.

E.g: This:

Route::get('my/method/(:num)', array('as' => 'name', 'uses' => 'controller@method'));

became like this:

Route::get('my/method/{id}', array('as' => 'name', 'uses' => 'yourController@yourMethod'))->where('id','[0-9]+');

(id is not a must, you can name it anything.)

Route::get('my/method/{foo}', array('as' => 'name', 'uses' => 'yourController@yourMethod'))->where('foo','[0-9]+');

For the filters, you can now use app/filters.php instead of putting them into your routes.php.

Arda
  • 6,756
  • 3
  • 47
  • 67