Upgrade Laravel 4.2 to Laravel 5.0

The Laravel 5.0 Shift automates the upgrade from Laravel 4.2 to Laravel 5.0. Using the Laravel 5.0 Shift to automatically upgrade your Laravel application has an estimated time savings of over 6 hours.


A Laravel application running Laravel 4.2.

Core Upgrades

The Laravel 5.0 Shift automates many of the upgrades listed in the Laravel Upgrade Guide, including:

  • Migrating all your app files to their new Laravel 5.0 locations (e.g. app/controllers to app/Http/Controllers, app/views to resources/views, etc).
  • Replacing core Filters with Middleware.
  • Upgrading your User model with the new user authentication in Laravel 5.0.
  • Changing Blade templates to use the new {!! !!} directives to avoid improper escaping with the differences in Laravel 5.
  • Upgrading various object references for Laravel 5, e.g. SoftDeletingTrait to SoftDeletes.
  • Adding the Form & HTML Facades from the Laravel Collective as they were removed in Laravel 5.
  • Updating composer.json for Laravel 5.

Additional Upgrades

In addition to the Core Upgrades, the Laravel 5.0 Shift performs additional upgrades beyond those listed in the Laravel Upgrade Guide, including:

  • Changing Model class inheritance from Eloquent to Model.
  • Adopting the PSR-2 coding style to match the coding style in Laravel.
  • Namespacing your existing App classes.
  • Migrating any lowercase folder to its Titlecase equivalent to match the PSR-4 namespacing in Laravel 5.

Manual Upgrades

There are some upgrades the Laravel 5.0 Shift can not perform automatically. When Shift detects these upgrades it adds a detailed comment on the Pull Request to help guide the manual upgrade.

  • Environment Configuration changed in Laravel 5.0. Since these files are often excluded from version control, Shift can not automatically upgrade your environment configuration from Laravel 4.2.
  • Filters were replaced by Middleware in Laravel 5.0. While core filters were upgraded, any custom filters will need to be manually converted to middleware.
  • The Pagination methods and the Eloquent remember method changed in Laravel 5.0. Given the dynamic nature of PHP and the various ways to use these methods, Shift can not reliably update these method calls automatically.

Still have questions? Message @laravelshift on Twitter or email shift@laravelshift.com.