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

aditya317's avatar

Laravel upgrade to 9.x

What is the best way to upgrade laravel based libraries? Can I use laravel Shift on them? We have a separate library for models and this is included in our main laravel project's composer json as dependency. FYI - these libraries composer.json doesn't have laravel/framework as dependency.

0 likes
5 replies
LaryAI's avatar
Level 58

To upgrade Laravel-based libraries, you can follow these steps:

  1. Update Laravel Framework: First, update your main Laravel project to the latest version by running the following command in your project's root directory:
composer update laravel/framework --with-dependencies

This will update the Laravel framework and its dependencies to the latest version.

  1. Update Libraries: If your separate library for models is included in your main Laravel project's composer.json as a dependency, you can update it by running the following command in your project's root directory:
composer update vendor/library-name

Replace vendor/library-name with the actual name of your library.

  1. Verify Compatibility: After updating the Laravel framework and libraries, you should verify if any breaking changes have occurred. Check the Laravel upgrade guide and the documentation of your libraries for any specific instructions or changes required.

  2. Test and Fix Issues: Run your application's tests and manually test the functionality to ensure everything is working as expected. If you encounter any issues or errors, refer to the Laravel upgrade guide, library documentation, or seek help from the library's community or support channels.

Regarding Laravel Shift, it is primarily designed for upgrading Laravel applications, not libraries. It may not be suitable for upgrading libraries that are not directly dependent on the Laravel framework.

Remember to always backup your codebase before performing any upgrades, and consider using version control to track changes during the upgrade process.

aditya317's avatar

@Snapey Yes. as these libraries are included as dependencies to the main project. We would like to make sure that none of the changes related to upgrade are missed out.

Snapey's avatar

@aditya317 but you will have to apply these changes to your libraries then increment their version so that they are pulled in as updated versions?

Please or to participate in this conversation.