Occasionally, I need to install an older version of Laravel when debugging something. Here's how.
The Laravel installer doesn't allow you to install specific Laravel versions (only branches), so the next best option is to use Composer to create a project directly using a previous Laravel version.
composer create-project --prefer-dist laravel/laravel:^10.0 old-project
The above command creates a project with Laravel 10, and gives the name old-project
. Just swap out with the version you need and the name of your project.
Of course, you can get more specific if you need to pull a minor release. Often, if there are minor releases and something changes that I need to investigate, we can get more specific.
composer create-project --prefer-dist laravel/laravel:^10.2.3 old-project
And that's a simple way to install an older version of Laravel.