Automatically upgrade your Laravel app with Shift

Published on by

Automatically upgrade your Laravel app with Shift image

Laravel Shift is a new project aimed at automatically upgrading out of date Laravel apps up to the current version. The way it works is you sign-in with either Github or BitBucket, purchase a shift (an upgrade package), and then review the pull request it automatically creates.

I had a chance to speak with Jason, the lead developer on the project and what follows is a Q&A about Shift:

Can you tell us where the idea for Laravel Shift came from?

This past fall I gave a presentation at PHP[world] titled All Aboard for Laravel 5.1. While doing research for my presentation, I was surprised at the lack of resources for upgrading Laravel. There were a few blog posts and of course, the official Laravel Upgrade Guide, but no migration tools. I’ve seen migration tools for other frameworks, so I thought, “I should build one for Laravel”. I pitched the idea to Taylor at the conference and he wasn’t aware of any tool either. So during the Hackathon Laravel Shift was born.

Is the upgrade routine completely automated?

Yes, Laravel Shift is completely automated from start to finish.

To start, you sign in with your GitHub or Bitbucket account, choose a shift, specify your repo, and place your order.

Once payment is received the Laravel Shift account is added as a collaborator to your repo and your shift is added to the job queue.

When the job is finished, a new branch containing the changes is pushed to your repo and a pull request (PR) with additional comments is opened for you to review the changes before merging.

Will it work on pretty much on any app? Or are there things to watch out for?

Laravel Shift will work on any app. However, it works best for apps that do things the “Laravel Way”. So if you’ve coded away from Laravel conventions or abuse the dynamic nature of PHP, there may be more manual work for you to do before merging.

It’s important to note this is by design. Laravel Shift is opinionated about the way it upgrades your app. This way after you merge the shift you know your app is upgraded and not in some hybrid state between the previous and the current version.

Have you had any that couldn’t be converted? What happens in that case?

Laravel Shift is currently in alpha. So I’m still shaking out the bugs. Only one I considered major. I push updates nightly and stay in contact with users during the alpha release in an effort to improve each shift.

Laravel Shift is pretty cautious. If it can’t reliably perform the upgrade automatically, it will leave a detailed comment on the PR so you can upgrade manually.

It’s also important to understand that Laravel Shift uses Git as its foundation. Everything is done on a separate branch and submitted in a PR. This way you have the chance to review and perform any additional changes before merging or close it if it didn’t meet your needs.

If there is an issue, users are encouraged to comment on the PR. This makes it easier to talk about the code since its in front of us. Twitter is also a way to check or report any issues – @laravelshift.

Before the final release, I plan to build a way to allow users to request their shift be rerun. This way there’s an immediate and automated way for you to resolve issues.

To go from Laravel 4.2 to the latest would you need to go through the process three times? 4.2 to 5.0, 5.0 to 5.1, 5.1 to 5.2, etc…

Yes, you would need to do all three shifts separately. This is by design. Even though some shifts are for minor releases, there’s still a lot being upgraded. Laravel Shift does more than what’s listed in the Laravel Upgrade Guide. Plus there’s other things to consider like package dependencies and new configuration options. So you really need to review before performing the next shift.

***

If you have a project that needs updating give Laravel Shift a try.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Tinkerwell

Version 4 of Tinkerwell is available now. Get the most popular PHP scratchpad with all its new features and simplify your development workflow today.

Visit Tinkerwell

The latest

View all →
Use Ollama LLM Models Locally with Laravel image

Use Ollama LLM Models Locally with Laravel

Read article
TallStackUI - a new component library for TALL Stack apps image

TallStackUI - a new component library for TALL Stack apps

Read article
Laravel 10.34 Released image

Laravel 10.34 Released

Read article
Laravel Tailwind Merge image

Laravel Tailwind Merge

Read article
Generate Validation Rules from a Database Schema in Laravel image

Generate Validation Rules from a Database Schema in Laravel

Read article
A Feature Flags Implementation for Filament image

A Feature Flags Implementation for Filament

Read article
Honeybadger logo

Honeybadger

Zero-instrumentation, 360 degree coverage of errors, outages and service degradation.

Honeybadger
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Oh Dear logo

Oh Dear

Oh Dear is the best all-in-one monitoring tool for all your Laravel apps.

Oh Dear
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
LoadForge logo

LoadForge

Easy, affordable load testing and stress tests for websites, APIs and databases.

LoadForge
Paragraph logo

Paragraph

Manage your Laravel app as if it was a CMS – edit any text on any page or in any email without touching Blade or language files.

Paragraph
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. Partner with Lucky Media, your favorite Laravel Development Agency!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce