Laravel entry learning document

										laravle总结
一丶安装
	1.首先安装compser。


	2.安装好compser后在cmd命令中输入compser出现

Insert picture description here
The installation is successful!

	3.安装php的环境(自己用的是phpstudy,php环境安装包有很多大家可以自己百度哈)。


	4.配置环境变量右键我的电脑->点击属性->点击高级系统保护。

Insert picture description here
Click Environment Variables-> Find the Path variable in the system environment and
Insert picture description here
click Edit. Add a semicolon after his original path. Write your php file path after the semicolon. Here you should pay attention to the laravel's PHP version> = 7.0.0 .

	5.在cmd命令行中输入php -v

Insert picture description here
When the php version number appears, it indicates that the environment variable configuration is successful.

	6.全局配置将composer.phar文件复制到php.exe文件目录下,并创建composer.bat文件 将 @php "%~dp0composer.phar" %* 放到composer文件中

Here is a little trick. After composer -v is executed, the composer command is still not found. Copy the composer.phar in the directory, remove the suffix and change it to composer.

	7.设置中国全量镜像
	首先用 composer config -gl repo.packagist 命令查看镜像地址

Insert picture description here
Find composer Chinese network: https://pkg.phpcomposer.com/
View the method to copy and execute the command
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Check again to find that the configuration has been successful
Insert picture description here

	8.现在就可以用compser安装laravel了,当然php版本要>=7.0.0。
		在有composer文件的目录中打开cmd,输入命令composer global require "laravel/installer"
		就可以安装laravel,这种很容易出错,因为下载的版本不确定,所以可以用composer create-		project --prefer-dist laravel/laravel blog "5.5.*"来下载一个指定版本的laravel
		
	9 如果您的laravel是项目的话需要数据库迁移,如果没项目更改一下配置文件在phpstudy上配置下网站就可以使用了

2. Directories
1. Controllers
Most beginners do n’t know much about the directory structure of laravel. At that time, I had suffered a lot of directories when I was learning laravel. The directory
where the controller is located is app / Http / Controllers /
2. Configuration files
Config directory, this directory contains all configuration files, it is recommended to take a look at
3.Database directory
This directory generally contains database migration files and fill files
4.Public directory
public directory contains the entry file index.php and front-end files (css, js, pictures, etc.)
5.resources directory
This directory is very important, generally put uncompiled native front-end resource files, of course, the view corresponding to the controller is also placed here, and the other is the suffix name here Not HTML but
Insert picture description here
6.Routes directory
This directory is also very important. This is a file
Insert picture description here
that defines the route. This post, get is the way of passing values. Any means that no matter what way of passing values, the
Insert picture description here
above is the definition. Routing in that module
Insert picture description here
This is the definition of routing, the link address on the left is the access address, and the file address on the right is the point.
For example, this means that when you access student / delete, you will access the delete method in the student controller. It
doesn't matter if the user actually writes or not, mainly I think it looks better.

This is the more important collection of directories, and this article is over now, I hope to help you! ! !

Published 4 original articles · won 10 · views 181

Guess you like

Origin blog.csdn.net/DarKer_LB/article/details/105378744