📜  laravel init - PHP (1)

📅  最后修改于: 2023-12-03 15:32:33.457000             🧑  作者: Mango

Laravel Init - PHP

Laravel Init is a command-line interface (CLI) tool for quickly setting up a new Laravel application. It automates the process of setting up a new Laravel project by creating a new directory, installing the Laravel framework, and setting up the necessary configuration files.

Installation

To install Laravel Init, you will need to have Composer installed on your machine. You can then install Laravel Init globally using the following command:

composer global require jasonmccreary/laravel-init

After installing Laravel Init, you should be able to run the laravel-init command from the command line.

Usage

To create a new Laravel project using Laravel Init, simply navigate to the directory where you want to create the project and run the following command:

laravel-init my-project

Replace my-project with the name of your project.

Laravel Init will then create a new directory called my-project, install the Laravel framework, and set up the necessary configuration files.

Options

Laravel Init has several options that you can use to customize the new Laravel project that it creates. Here are some of the most commonly used options:

--composer

The --composer option allows you to specify the path to the Composer binary. If you have multiple versions of Composer installed or Composer is not in your system path, you can use this option to specify the path to the correct version of Composer.

--version

The --version option allows you to specify the version of Laravel to install. By default, Laravel Init will install the latest version of Laravel, but you can use this option to install an older version of Laravel if necessary.

--dev

The --dev option installs Laravel in "dev" mode, which includes additional development dependencies such as PHPUnit and PHP-CS-Fixer.

--auth

The --auth option sets up Laravel's built-in authentication scaffolding, which includes a login and registration system.

Conclusion

Laravel Init is a powerful tool for quickly setting up new Laravel projects. With just a few commands, you can create a new Laravel project with all of the necessary configuration files set up and ready to go. Give it a try on your next project, and see how much time and effort it can save you!