0_Project construction

environment

PHP 7.0

Create project

 
  1. $ install composer 【这个命令一般都很慢,需要翻墙去下载composer,然后安装】
  2. $ composer create-project --prefer-dist laravel/laravel 项目名 【创建项目】
  3. $ composer install【安装laravel扩展包】

use

Note that to use the artisan command, you need to use it in the current directory of the project

1. Create a controller using artisan

 
  1. $ php artisan make:controller Admin/LoginController

2. middleware

 
  1. $ php artisan make:middleware CheckAge

// check routes
// in route,use ‘Route::resources’ to create a group routes

3. View routing

 
  1. $php artisan route:list

// create rule request
php artisan make:request StoreBlogPost

// create model

4. Create a model

 
  1. $php artisan make:model Http/Models/Admin/Auth

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325935056&siteId=291194637