To create a new Laravel project using Composer, follow these steps:
Install Composer on your system if you haven't already. You can download it from the official website: https://getcomposer.org/
Open your command line interface (CLI) or terminal.
Navigate to the directory where you want to create your Laravel project.
Run the following command to create a new Laravel project:
composer create-project --prefer-dist laravel/laravel project-name
Replace project-name
with the name you want to give to your project.
Composer will download and install the Laravel framework and its dependencies. It may take a while depending on your internet connection and system speed.
Once the installation is complete, navigate to the project directory by running the following command:
cd project-name
Create a copy of the .env.example
file and rename it to .env
.
Generate an application key by running the following command:
php artisan key:generate
That's it! You have successfully created a new Laravel project using Composer. You can now start developing your Laravel application.