Laravel new project
To create a new Laravel project, you can use the following command:
composer create-project --prefer-dist laravel/laravel project-name
Replace project-name
with the name you want to give your project.
This command will create a new Laravel project in a directory with the same name as the project name you specified. The project will include the basic files and directories needed to get started with Laravel.
Here's a breakdown of the command:
composer
: This is the command-line tool for managing dependencies in PHP.create-project
: This is a command that creates a new project from a Composer package.--prefer-dist
: This option tells Composer to download the package in a compressed format (i.e., a.zip
file) instead of cloning the Git repository.laravel/laravel
: This is the package name for the Laravel framework.project-name
: This is the name of the project you want to create.
Once you run the command, Composer will download the Laravel package and create the project directory. You can then navigate to the project directory and start building your application.
Here's an example of what the command might look like:
composer create-project --prefer-dist laravel/laravel my-new-project
This would create a new Laravel project called my-new-project
in the current directory.
Note: Make sure you have Composer installed on your system before running this command. If you don't have Composer installed, you can download it from the official Composer website.