Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Laravel Installer "laravel/installer" to latest version?

I tried to update my laravel/installer using the command:

composer global update laravel/installer

But it only upgraded its minor version (assuming that it uses Semantic Versioning).

Package operations: 0 installs, 1 update, 0 removals
  - Updating laravel/installer (v2.1.0 => v2.3.0): Downloading (100%)

Then I execute the update command again:

composer global update laravel/installer

But outputs:

Nothing to install or update

I now uses PHP 7.4.4 (cli) obtained using php -v so I assume that it should be able to upgrade to latest which is Laravel Installer 3.0.1.

like image 389
marlo Avatar asked Apr 06 '20 01:04

marlo


People also ask

How can I update my Laravel version?

The recommended method of upgrading is to create a new Laravel 5.0 install and then to copy your 4.2 site's unique application files into the new application. This would include controllers, routes, Eloquent models, Artisan commands, assets, and other code specific to your application.

Can I upgrade Laravel 5.8 to 8?

By default, Laravel 5.8 uses PHPUnit 7. However, you may optionally upgrade to PHPUnit 8, which requires PHP >= 7.2. In addition, please read through the entire list of changes in the PHPUnit 8 release announcement.


1 Answers

If running composer global update laravel/installer is not enough to upgrade the the desired version, there might be package dependencies that restricts the upgrade to the latest.

I do not know if there is a composer option to do that on global scope but the following commands works for me:

# uninstall the package
composer global remove laravel/installer

# reinstall
composer global require laravel/installer

The 1st process outputs the outdated packages dependencies that are removed with the laravel/installer package.

Then the 2nd process installs the latest laravel/installer with the updates dependencies.

Laravel documentation does not include how to update the installer package yet.


Update: Adding Documentation link on how to update a composer package.

composer require specific version documentation.

php composer.phar require "vendor/package:2.*" vendor/package2:dev-master

As we can see, specific version could be supplied after the colon.

https://getcomposer.org/doc/03-cli.md#require

like image 188
marlo Avatar answered Oct 03 '22 17:10

marlo