Create new laravel app with cmd
To create a new Laravel app using the command line, 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.
Here's a breakdown of the command:
composer
: This is the command-line tool for managing your PHP dependencies.create-project
: This is the command for creating a new project.--prefer-dist
: This option tells Composer to download the project in its most optimized form, which is a compressed archive.laravel/laravel
: This is the package name for the Laravel framework.project-name
: This is the name of your project.
When you run this command, Composer will download the Laravel framework and create a new project with the specified name. The project will include the basic directory structure and files needed to get started with Laravel.
For example, if you run the command:
composer create-project --prefer-dist laravel/laravel my-laravel-app
Composer will create a new directory called my-laravel-app
and populate it with the basic Laravel files and directories.
Note: Make sure you have Composer installed on your system and that you are running the command in a directory where you have write permissions.