国内几个镜像源

composer config -g repo.packagist composer https://packagist.composer-proxy.org
composer config -g repo.packagist composer https://p.staticq.com 
composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer config -g repo.packagist composer https://packagist.laravel-china.org

阿里云镜像
https://mirrors.aliyun.com/composer/

腾讯云镜像
https://mirrors.cloud.tencent.com/composer/

配置只在当前项目生效

composer config repo.packagist composer https://packagist.phpcomposer.com
#取消当前项目配置
composer config --unset repos.packagist

配置全局生效

composer config -g repo.packagist composer https://packagist.phpcomposer.com
#取消全局配置
composer config -g --unset repos.packagist

使用第三方软件快速修改、切换 composer 镜像源

crm => composer registry manager

#安装 crm
composer global require slince/composer-registry-manager

#列出当前可用的所有镜像源
composer repo:ls

    composer ---------  https://packagist.org
    phpcomposer ------  https://packagist.phpcomposer.com
    composer-proxy ---  https://packagist.composer-proxy.org
    laravel-china ----  https://packagist.laravel-china.org

#使用 phpcomposer 镜像源
composer repo:use phpcomposer

参考:Composer 国内加速,修改镜像源