Shift with red gradient lettering
Loading navigation...

Upgrade Livewire 1.x to Livewire 2.x

The Livewire 2.x Shift automates the upgrade of your Laravel application from Livewire 1.x to Livewire 2.x. Using the Livewire 2.x Shift to automatically upgrade your Laravel application has an estimated time savings of 1 hour.

Livewire 2 has reached end of life. Shift strongly recommends continuing your upgrade with the Livewire 3.x Shift and Livewire 4.x Shift.

Screenshot of a pull request with automated changes from the Livewire 2.x Shift

Requirements

  • A Laravel application running Livewire 1.x.
  • Laravel 7.x or higher.

Core Upgrades

The Livewire 2.x Shift automates the changes from the Livewire 2 upgrade guide, including:

  • Converting Route::livewire() to Route::get().
  • Preserving full-page component layouts.
  • Removing automatic property casts.
  • Renaming $updatesQueryString to $queryString.
  • Preserving the Bootstrap pagination theme.
  • Renaming JavaScript hooks and their arguments.
  • Adding the Turbolinks adapter.

Additional Upgrades

In addition to the Core Upgrades, the Livewire 2.x Shift performs additional upgrades, including:

  • Merging new configuration options.
  • Applying your code style.
  • Modernizing PHP syntax, such as short arrays and the ::class constant.
  • Bumping your dependencies, including Alpine.js and Livewire Vue.

Manual Upgrades

There are some upgrades the Livewire 2.x Shift can not perform automatically, such as custom property casters, route group layouts, and JavaScript hooks using the new arguments. When Shift detects these it adds a detailed comment to the Pull Request to guide any additional steps you may need to do manually.

While Shift attempts to detect and automate the updates for popular packages, you may need to update some of your dependencies manually. Always review the changelog for your dependencies for any additional changes.