Laravel 7.11 发布
Laravel团队发布了 v7.11.0,该版本支持电子邮件 Unicode 验证,split() “stringable” 方法,两个“or where in raw” 查询构建方法,以及对 7.x 分支的所有最新更新。
支持 FILTER_FLAG_EMAIL_UNICODE
@mpyw 贡献了使用 FILTER_FLAG_EMAIL_UNICODE
进行邮件验证功能。 这对于允许在电子邮件的本地部分而不是域名部分使用 unicode 很有用:
$request->validate([
'email' => 'email:filter_unicode'
]);
注意: email:filter
规则现在在本地和域部分都禁止Unicode,并且 email:rfc
都允许Unicode。
将 split() 添加到 Stringable 类
Nicolas Perraut为 Stringable 类贡献了 split()
方法作为 preg_split()
的代理,允许使用正则表达式替代explode()
:
Str::of('hypertext language, programming')
->split('/[\s,]+/');
/*
Illuminate\Support\Collection {#3523
all: [
"hypertext",
"language",
"programming",
],
}
*/
新增 “or where in raw” 子句
@jrking4 贡献了 orWhereIntegerInRaw()
和 orWhereIntegerNotInRaw()
查询方法用于 “or where in raw” 的情况:
$builder
->where('id', '=', 1)
->orWhereIntegerInRaw('id', ['1a', 2])
发行说明
您可以在GitHub上看到新功能和更新的完整列表以及 7.10.0 and 7.11.0 之间的区别。 您可以在最新的v7 changelog 中查看所有内容:
v7.11.0
新增
- 邮箱验证新增 FILTER_FLAG_EMAIL_UNICODE 支持 “email:filter_unicode” (#32711, 43a1ed1)
- 新增
Illuminate\Support\Stringable::split()
(#32713, 19c5054) - 新增
orWhereIntegerInRaw()
和orWhereIntegerNotInRaw()
到Illuminate\Database\Query\Builder
(#32710) - 新增
Illuminate\Cache\DatabaseStore::add()
(7fc452b)
修复
- 修复 belongsToMany 关联关系问题(c5e88be)
- 允许在严格模式下覆盖MySQL服务器版本 (#32708)
- 新增布尔类型不需要字符配置 (#32716)
- 修复
Illuminate\Foundation\Testing\PendingCommand
容器不解析‘OutputStyle::class’ (#32687) - 清除已解决的事件门面
Illuminate\Foundation\Testing\Concerns\MocksApplicationServices::withoutEvents()
(d1e7f85)
本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。
我还在用 5.5 :joy::joy:
在用Laravel6.x :speak_no_evil: :speak_no_evil: :speak_no_evil:
版本帝啊 :joy:
项目还没有做完你突然发现所使用的版本不再更新维护啦.