如何更新 Laravel 命令?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52172816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:01:35  来源:igfitidea点击:

How to update Laravel command?

phplaravelcomposer-php

提问by Javad

I used this command for installing Laravel:

我使用这个命令来安装 Laravel:

composer global require "laravel/installer"

For creating a project I use :

为了创建一个项目,我使用:

laravel new project

Today Laravel 5.7 was released, and I'm looking for installing it using the laravelcommand but I couldn't do it. Instead, a new laravel project was created with Laravel 5.6.33. I need some help.

今天 Laravel 5.7 发布了,我正在寻找使用laravel命令安装它,但我无法做到。相反,使用 Laravel 5.6.33 创建了一个新的 Laravel 项目。我需要帮助。

Note:I can create a project with Laravel 5.7 with this command, but I need to update my required Laravel and make a project with laravel 5.7 by using the laravel command:

注意:我可以用这个命令用 Laravel 5.7 创建一个项目,但我需要更新我需要的 Laravel 并使用 laravel 命令用 Laravel 5.7 创建一个项目:

composer create-project --prefer-dist laravel/laravel blog

回答by Christian Gallarmin

Update your laravel/framework dependency to 5.7.* in your composer.jsonfile.

将文件中的 laravel/framework 依赖项更新为 5.7.* composer.json

Run this command

运行这个命令

composer update

composer update

composer create-project --prefer-dist laravel/laravel blog

composer create-project --prefer-dist laravel/laravel blog

Try this!~

试试这个!~

回答by Pedro Sim?o

I think that Laravel 5.7 Installation Documentation, has the exact instructions for your problem.

我认为Laravel 5.7 安装文档对您的问题有确切的说明。

  • Install the Laravel Installer via composer: composer global require "laravel/installer"
  • Run the command: laravel new <project-name>
  • 通过 composer 安装 Laravel 安装程序: composer global require "laravel/installer"
  • 运行命令: laravel new <project-name>

回答by James Christian Kaguo

If you want to globally update laravel to the new version just run

如果你想全局更新 laravel 到新版本只需运行

composer global require laravel/installer

composer global require laravel/installer

to update globally

全局更新

回答by MCFreddie777

Try this to update laravel installer on global level:

试试这个来更新全局级别的 laravel 安装程序:

composer global update

回答by Alexander Villalobos

try this command

试试这个命令

composer create-project --prefer-dist laravel/laravel blog "5.7.*"