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.

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

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

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
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant 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
Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate

Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate
Rector logo

Rector

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

Rector
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Asymmetric Property Visibility in PHP 8.4 image

Asymmetric Property Visibility in PHP 8.4

Read article
Access Laravel Pulse Data as a JSON API image

Access Laravel Pulse Data as a JSON API

Read article
Laravel Forge adds Statamic Integration image

Laravel Forge adds Statamic Integration

Read article
Transform Data into Type-safe DTOs with this PHP Package image

Transform Data into Type-safe DTOs with this PHP Package

Read article
PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell image

PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell

Read article
Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3 image

Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3

Read article