How to create a new laravel project

To create a new Laravel project, you can use the Laravel installer, which is a command-line tool that helps you create a new Laravel project with ease. Here are the steps:

Method 1: Using the Laravel Installer

  1. Open your terminal or command prompt.

  2. Run the following command to install the Laravel installer:

    composer global require laravel/installer
  3. Once the installer is installed, navigate to the directory where you want to create your new Laravel project.

  4. Run the following command to create a new Laravel project:

    laravel new project-name

    Replace project-name with the name of your project.

  5. The installer will create a new directory with the name you specified, and inside that directory, it will create the basic structure for a Laravel project.

  6. You can then navigate into the project directory and start building your application.

Method 2: Using Composer

  1. Open your terminal or command prompt.

  2. Run the following command to create a new Laravel project using Composer:

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

    Replace project-name with the name of your project.

  3. The command will create a new directory with the name you specified, and inside that directory, it will create the basic structure for a Laravel project.

  4. You can then navigate into the project directory and start building your application.

Additional Options

When creating a new Laravel project, you can also specify additional options to customize the project. Here are some examples:

For example, to create a new Laravel project with the development dependencies and without ansi color output, you can run the following command:

composer create-project --prefer-dist --dev --no-ansi laravel/laravel project-name