Home > PHP Framework > Laravel > How to set up laravel project

How to set up laravel project

青灯夜游
Release: 2023-01-13 00:40:30
Original
4686 people have browsed it

How to create a project: 1. Install the Composer tool; 2. Install the "Laravel installer" through the "composer global require "laravel/installer"" command; 3. Execute the "laravel new project name" command to create Project is enough.

How to set up laravel project

The operating environment of this tutorial: Windows 7 system, Laravel version 5, Dell G3 computer.

How to create a laravel project

1. Install Composer

Create a Laravel project, First you need to install Composer. If there is no installation reference https://docs.phpcomposer.com/00-intro.html

2. Install Laravel installer

pass Composer installs Laravel installer:

composer global require "laravel/installer"
Copy after login

Note: Make sure $HOME/.composer/vendor/bin is in the system path (the corresponding path in Mac is ~/.composer/vendor/bin, the Windows corresponding path is ~/AppData/Roaming/Composer/vendor/bin, where ~ represents the current user’s home directory), otherwise The laravel command cannot be called from any path on the command line.

3. Create a Laravel application

After the installation is completed, you can create a laravel application by simply laravel new application name. For example, we install a laravel application in the current directory with the name Application of blog_system

laravel new bolg_system
Copy after login

If you have installed the laravel installer before, it is recommended to use the composer global update command to update the laravel installer

You can also use Composer Create -Project to create a laravel application

composer create-project --prefer-dist laravel/laravel blog
Copy after login

If you want to download and install other versions of Laravel applications, such as version 5.6, you can use this command:

composer create-project --prefer-dist laravel/laravel blog 5.6.*。
Copy after login

Related recommendations: The latest five Laravel video tutorials

The above is the detailed content of How to set up laravel project. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template