laravel 5.5 升级到 5.6

脑子混乱停一下

前后端分离与游戏部分

admin 与 user 需要不同的入口

数据部分有一些是通用的,分离 admin 域 与 user 域 是有必要的

admin verify 将 config 提取出来有一定优势

quasar还是要加强的

码力 图力 不足…… 但是没什么用……

laravel Upgrading To 5.6.0 From 5.5

1
2
3
4
5
"darkaonline/l5-swagger": "5.6.*",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/passport": "^5.0",
"phpunit/phpunit": "~7.0"

之后会出现错误

1
Type error: Argument 2 passed to Symfony\Component\HttpFoundation\Request::setTrustedProxies() must be of the type integer, array given, called in /Users/k11/laravel/web/vendor/fideloper/proxy/src/TrustProxies.php on line 5

对应upgrade Trusted Proxies

App\Http\Middleware\TrustProxies

1
2
3
4
5
6
7
protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];

1
protected $headers = Request::HEADER_X_FORWARDED_ALL; 

Bootstrap 4

1
2
npm uninstall --save-dev bootstrap-sass
npm install bootstrap popper.js

resources/assets/js/bootstrap.js

1
2
3
4
5
try {
window.$ = window.jQuery = require('jquery');

require('bootstrap-sass');
} catch (e) {}

改为

1
2
3
4
5
try {
window.$ = window.jQuery = require('jquery');

require('bootstrap');
} catch (e) {}

添加

1
window.Popper = require('popper.js').default;

resources/assets/sass/app.scss

1
@import “~bootstrap-sass/assets/stylesheets/bootstrap”

改为

1
2
3
4
5
6
@import “~bootstrap/scss/bootstrap.scss”

.navbar-laravel {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

resources/assets/sass/_variables.scss

删除全部内容后写入

1
2
3
4
5
6
7
8
9
10
11
12
13
// Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");

// Variables
@import "variables";

// Bootstrap
@import '~bootstrap/scss/bootstrap';

.navbar-laravel {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

方法二

直接复制laravel 5.6 版本的 resources package.jsonlaravel 5.5下覆盖。

swagger

config/l5-swagger中设置好passport后使用下方代码引入每个请求

l5-swagger中使用的是password方式,所以不必限制请求地址

1
2
3
*     security={
* {"passport": {}}
* },

mailserver 修复

起因 mac os 上不能登录邮箱了,手机却可以。查看logs发现是错误如下

1
TLS handshaking: SSL_accept() failed 

查找issues得知tomav/docker-mailserver更新

增加一个新变量

TLS_LEVEL 要想兼容老 Mac OS 要设置为intermediate

以上