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
Laravel Forge

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

Visit Laravel Forge
Laravel Forge logo

Laravel Forge

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

Laravel Forge
Tinkerwell logo

Tinkerwell

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

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
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
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

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
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
All Green logo

All Green

All Green is a SaaS test runner that can execute your whole Laravel test suite in mere seconds so that you don't get blocked – you get feedback almost instantly and you can deploy to production very quickly.

All Green
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article
Basset is an alternative way to load CSS & JS assets image

Basset is an alternative way to load CSS & JS assets

Read article
Integrate Laravel with Stripe Connect Using This Package image

Integrate Laravel with Stripe Connect Using This Package

Read article
The Random package generates cryptographically secure random values image

The Random package generates cryptographically secure random values

Read article
Automatic Blade Formatting on Save in PhpStorm image

Automatic Blade Formatting on Save in PhpStorm

Read article