Backend Development 5 min read

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:

<code>composer global require "laravel/installer:^4.0"</code>

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:

<code>composer global remove laravel/installer</code>
<code>composer global require laravel/installer</code>

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 :

<code>{
    "require": {
        "laravel/installer": "^4.0"
    }
}</code>

Then run a global update:

<code>composer global update</code>

Verify the Update

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

<code>laravel --version</code>
<code>Laravel Installer 4.0.3</code>

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 :

<code>laravel new myapp --jet --stack=inertia --team</code>
ComposerInstallerLaravelUPDATE
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

login 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.