Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincej's avatar
Level 15

Why use Laravel Shift to upgrade?

Dumb question perhaps. Why not just create an empty L11 project and then just clone your app. Yes, I am independent and do not work with anyone else. Just me.

One concern I have is that my app uses Laravel/ui and Twitter Bootstrap. Also I use Laravel Mix. I had a bad experience with Vite. So am I going to be forced to use Breeze and Vite?? How about only Breeze for the login page and nothing else. And ripping Vite and installing Mix could be a pain, no??

Many thanks for all advice.

0 likes
7 replies
LaryAI's avatar
Level 58

Using Laravel Shift to upgrade your application has several advantages over manually creating a new Laravel project and migrating your code. Here's why you might consider using Laravel Shift:

  1. Automated Process: Laravel Shift automates the upgrade process by applying the official Laravel upgrade guide. It performs many of the upgrade tasks automatically, which can save you a significant amount of time and reduce the risk of human error.

  2. Custom Upgrade Steps: Shift tailors the upgrade process to your application by detecting your specific version and applying the necessary incremental changes. This means it can handle customizations and packages that you might have added to your application.

  3. Detailed Pull Request: After the upgrade, Shift provides a detailed pull request that outlines every change. This allows you to review the changes, understand what was done, and make any necessary adjustments.

  4. Compatibility Checks: Shift checks for compatibility issues with your current packages and can help you upgrade those packages to versions compatible with the new Laravel version.

  5. Time-Saving: Manually upgrading can be time-consuming, especially if you're not familiar with all the changes introduced in the new Laravel version. Shift does the heavy lifting for you, allowing you to focus on other aspects of your application.

Regarding your concerns:

  • Laravel/ui and Bootstrap: You can continue using Laravel/ui and Bootstrap in Laravel 11. Laravel Breeze and other starter kits are optional, and you are not forced to use them.

  • Laravel Mix and Vite: Laravel 9 introduced Vite as the default build tool, but you are not required to use it. You can continue using Laravel Mix if that's your preference. You would need to manually configure your project to use Mix instead of Vite, but this is a one-time setup.

Here's a basic guide on how to revert to using Laravel Mix if your new Laravel project is set up with Vite:

  1. Remove Vite-related dependencies:
npm uninstall vite laravel-vite-plugin
  1. Install Laravel Mix:
npm install laravel-mix --save-dev
  1. Add a webpack.mix.js file to your project root with your desired configuration. Here's a basic example:
const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .postCss('resources/css/app.css', 'public/css', [
        //
    ]);
  1. Update your package.json scripts to use Mix commands:
"scripts": {
    "dev": "npm run development",
    "development": "mix",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "mix hot",
    "prod": "npm run production",
    "production": "mix --production"
}
  1. Run npm install and then npm run dev to compile your assets.

Remember to remove any Vite-specific configuration from your resources/views if it exists.

In conclusion, while you can manually upgrade your Laravel application, using Laravel Shift can streamline the process and help you avoid potential pitfalls. If you prefer to stick with Laravel Mix and Bootstrap, you can certainly do so, and you're not obligated to switch to Vite or Breeze.

jlrdw's avatar

I have never needed shift, I manually upgrade but I use a compare tool. And of course read the upgrade guide carefully. If you do not make changes often you don't really need vite or mix. I have never used neither of those.

Edit:

For version 10, I started a new project and just copied my models, views, controllers, and custom classes over.

I will probably do the same for version 11, but read all the changes.

vincej's avatar
Level 15

@jlrdw Thanks for that. If I copy my app files into L11, then how do I connect that up into my git repo? I thought I had to clone.

martinbean's avatar

@vincej Vite and Breeze aren’t a necessity to use Laravel 11. You can also upgrade (https://laravel.com/docs/11.x/upgrade#upgrade-11.0) instead of creating a new application and then copying files over.

I always just update otherwise I’d be creating new apps on an annual basis. I’ve got apps that started out on Laravel 5 that are now on 10.x (11.x upgrade is pending). It means I’ve got a Git history of the project for its entire lifetime, rather than it just randomly starting a few months ago with a massive commit where I’ve dumped in the files from a previous incarnation.

vincej's avatar
Level 15

@martinbean thanks for that. I will upgrade.

I can't remember why, but in the past I had a terrible time with vite.

Snapey's avatar

Hi Vince. I would follow the upgrade instructions.

Please or to participate in this conversation.