laravel-5_5文檔地址:
https://laravelacademy.org/category/laravel-5_5php
模板變量文檔:html
https://laravelacademy.org/post/7888.htmlnginx
Eloquent ORMlaravel
https://laravelacademy.org/post/8194.htmljson
一、安裝
composer create-project --prefer-dist laravel/laravel blog 5.5.*
二、修改成國內庫
composer.json添加:
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.laravel-china.org"
}
}
三、
生成模型類
php artisan make:model Models/Test
生成控制器類
php artisan make:controller UserController
php artisan make:controller Admin/UserController
php artisan make:controller Home/UserController
四、nginx.conf配置
server {
listen 82;
server_name localhost;
charset utf-8;
index index.php;
root ***/blog/public;
location / {
index index.php;
root ***/blog/public;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
五、csrf
在form中使用:
csrf_field() 或
<input type="hidden" name="_token" value="{{ csrf_token() }}">
另: 添加csrf檢測排除,在 VerifyCsrfToken 文件中添加
composer
本博客地址: wukong1688post
本文原文地址:http://www.javashuo.com/article/p-xeljtxtu-u.htmlurl
轉載請著名出處!謝謝~~orm