Upgrade Lumen 5.1 to Lumen 5.2

The Lumen 5.2 Shift automates the upgrade from Lumen 5.1 to Lumen 5.2. Using the Lumen 5.2 Shift to automatically upgrade your Lumen application has an estimated time savings of 1 hour.


A Lumen application running Lumen 5.1.

Core Upgrades

The Lumen 5.2 Shift automates many of the upgrades listed in the Lumen Upgrade Guide, including:

  • Removing the SelfHandling interface from Jobs.
  • Adding new Lumen 5.2 bootstrap configuration.
  • Upgrading references for Lumen 5.2.
  • Updating composer.json for Lumen 5.2.

Additional Upgrades

In addition to the Core Upgrades, the Lumen 5.2 Shift performs additional upgrade beyond those listed in the Lumen Upgrade Guide, including:

  • Adopting the PSR-2 coding style to match the coding style in Lumen.
  • Modernizing PHP syntax, such as the short array syntax.
  • Adding new core files now included in Lumen 5.2.
  • Removing core files not included Lumen 5.2.
  • Detecting usages of *Collection* methods changed in Lumen 5.2.
  • Converting usages of deprecated methods.

Manual Upgrades

There are some upgrades the Lumen 5.2 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.

  • Lumen 5.2 no longer includes *sessions* or *views* in an effort to focus solely on serving stateless, JSON APIs. If your app requires these features, you should use the full Laravel framework.
  • Several of the Collection methods changed in Lumen 5.2. Given the dynamic nature of PHP and the various ways to implement these methods in Lumen, Shift can not reliably update these method calls automatically.
  • Eloquent and its integration with MySQL changed in Lumen 5.2. Since Lumen applications integrate databases differently, Shift does not currently perform these upgrades.

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