简体   繁体   English

使用命令“composer create-project laravel/laravel [我的项目名称]”是创建新 Laravel 项目的正确方法吗?

[英]Is using the command "composer create-project laravel/laravel [name of my project]" the correct way of creating a new Laravel project?

When creating a Laravel project I use the command "composer create-project laravel/laravel [name of my project]" .创建 Laravel 项目时,我使用命令"composer create-project laravel/laravel [name of my project]" It takes more than 5 minutes to create and also installs Laravel.创建并安装 Laravel 需要 5 多分钟。 Is this the correct way of creating a new Laravel Project?这是创建新 Laravel 项目的正确方法吗?

There are multiple ways to install Laravel. Laravel 有多种安装方式。 One of the simplest ways would be to install through composer with the command:最简单的方法之一是通过 Composer 使用以下命令进行安装:

composer create-project --prefer-dist laravel/laravel MyAppName
// -- flag means optional

But...但...

It depends on your internet speed.这取决于您的互联网速度。

Even on higher internet speeds, it takes 1-2 mins即使在更高的互联网速度下,也需要 1-2 分钟

Seems related似乎相关

To create a new Laravel Project via composer we need to install laravel first.要通过 composer 创建一个新的 Laravel 项目,我们需要先安装 Laravel。 Below command is used to download and install laravel using composer.下面的命令用于使用 composer 下载和安装 Laravel。

composer global require laravel/installer

Once Laravel get installed on your pc larevel new command will create a fresh Laravel installation in the directory you specify.在你的电脑上安装larevel new命令将在你指定的目录中创建一个全新的 Laravel 安装。

laravel new Project_name

Also you can create new laravel project via composer as well.你也可以通过composer创建新的laravel项目。 (I Used to create via Composer). (我曾经通过 Composer 创建)。 You can run the below command in your terminal to create new laravel project.您可以在终端中运行以下命令来创建新的 Laravel 项目。

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

It will take couple of minitues to create the project.创建项目需要几分钟的时间。 Once it done go the the project directory and run the command php artisan serve to start the development server at http://localhost:8000:完成后,进入项目目录并运行命令php artisan serve以在http://localhost:8000:启动开发服务器http://localhost:8000:

Refer Laravel Documentation for more information.有关更多信息,请参阅 Laravel文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM