Laravel 7.23 发布
Laravel团队发布v7.23.0与动态位置指令名称, 支持纯文本通知,构建新的查询方法, 以及最新的功能, 修复和改变7.x 部分功能:
Dynamic Slot Name Support
可以使用冒号来动态命名的功能 (:) prefix:
<x-slot :name="$foo">
{{-- ... --}}
</x-slot>
普通邮件通知
Julius Kiekbusch 增加了自定义纯文本email通知的能力。下面是邮寄人通过请求的测试用例:
class TestMailNotificationWithPlain extends Notification
{
public function via($notifiable)
{
return [MailChannel::class];
}
public function toMail($notifiable)
{
return (new MailMessage)
->view('html')
->text('plain');
}
}
使用Guzzle的sink可以假装Http
Sjors Ottjes 为 Guzzle 贡献了sink
选项用于 Laravel HTTP 客户端伪造请求提供了支持。 在正常使用Http客户端时,sink选项已经可以使用。 但是,使用 Http::fake(),它将停止工作。 来自 pull request 的一个测试 demo 可以更好地说明其工作方式:
$this->factory->fakeSequence()->push('abc123');
$destination = __DIR__ . '/fixtures/sunk.txt';
if (file_exists($destination)) {
unlink($destination);
}
$this->factory->withOptions(['sink' => $destination])->get('https://example.com');
$this->assertFileExists($destination);
$this->assertSame('abc123', file_get_contents($destination));
unlink($destination);
新的 Query Builder 方法
Ernestas Kvedaras 贡献了以下新的查询构造方法:
whereBetweenColumns
orWhereBetweenColumns
whereNotBetweenColumns
orWhereNotBetweenColumns
这些方法与 whereColumn
类似, 不过是针对 whereBetween
.
发行日志
您可以在GitHub上看到新功能和更新的完整列表以及 7.22.0和7.23.0 之间的区别。 以下发行说明直接来自 changelog:
You can see the full list of new features and updates below and the diff between 7.22.0 and 7.23.0 on GitHub. The following release notes are directly from the changelog:
v7.23.0
新增
- 新增动态插槽(指令)名称支持 (#33724)
- 在通知中新增了普通邮件 (#33725)
- 使用 Http::fake() 方法时支持
sink
配置项(#33720, fba984b) -
Illuminate\Database\Query\Builder
新增 whereBetweenColumns | orWhereBetweenColumns | whereNotBetweenColumns | orWhereNotBetweenColumns (#33728)
修改
本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。