How to Update the Laravel Installer to the Latest Version

This guide explains how to upgrade the Laravel installer to the latest version using Composer, covering three methods: composer require, uninstall and reinstall, and editing the global composer.json, with commands and verification steps.

php Courses
php Courses
php Courses
How to Update the Laravel Installer to the Latest Version

Updating the Laravel installer is essential for your workflow, and Composer makes it easy to install a new version, but what if you already have it installed?

The Laravel team has released a new major version of the Laravel installer that includes Jetstream support. The new version uses the composer create-project command behind the scenes instead of downloading an archive from Laravel's build server.

Because of this change, Taylor Otwell plans to shut down the build server within a month or two, so you should upgrade the installer as soon as possible.

Update the Installer

If you have globally required laravel/installer on your local machine, you can update it to the latest version using one of the following methods:

1. Composer Require

Run the following command to globally require the next major version:

composer global require "laravel/installer:^4.0"

If there are no dependency conflicts, you should now have the latest 4.x installer. It is recommended to update weekly, at least initially, to receive Laravel 8 merge updates and bug fixes.

2. Uninstall and Reinstall

If you encounter issues when updating with composer require, you can uninstall the old version globally and reinstall it:

composer global remove laravel/installer
composer global require laravel/installer

3. Update the Global composer.json File

Another approach is to edit your global composer.json (usually located at ~/.composer/composer.json) and set the required version to ^4.0:

{
    "require": {
        "laravel/installer": "^4.0"
    }
}

Then run a global update:

composer global update

Verify the Update

Regardless of the method you used, confirm that you have the correct version by running:

laravel --version
Laravel Installer 4.0.3

Bonus Options

The Laravel installer received additional options on the day Laravel 8 was released, such as --stack and --teams. The --stack option lets you configure the stack type to livewire or inertia:

laravel new myapp --jet --stack=inertia --team
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendPHPComposerinstallerLaravelUPDATE
php Courses
Written by

php Courses

php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.