Laravel 11.8版本發(fā)布- 一種新的驗證規(guī)則和手動使命令失效的能力
Laravel  /  管理員 發(fā)布于 10個月前   486
本周,Laravel團隊發(fā)布了v11.8,它提供了一個新的驗證規(guī)則,可以使handle()方法之外的命令失敗,
在make:mail期間創(chuàng)建視圖等等。
在模型中顯示事件:Show Command
Wendell Adriel為模型貢獻了一個Events部分:
show命令,該命令顯示在$dispatchsEvents屬性上定義的任何事件:
新建包含驗證規(guī)則
Andrew Brown提供了一個包含驗證規(guī)則,用于檢查以確保預期值包含在給定的輸入數組中:
return [
'allowed_ips' => ['present', 'nullable', 'array', 'contains:' . $request->ip()],
'allowed_ips.*' => ['required', 'ip'],
];
在PR的描述中,此示例確保用戶的IP位于allowed_ips陣列中。
您還可以傳遞多個參數,這將要求所有參數都存在于數據數組中。
有關更多詳細信息,請參閱拉動請求#51348。
手動使命令失效的能力
Len Woodward提供了在handle()方法之外手動使Artisan命令失敗的能力。
與Queue的$this->fail()方便方法一樣,命令現在可以手動使作業(yè)失敗:
public function handle()
{
$this->trigger_failure();
}
protected function trigger_failure()
{
$this->fail('Whoops!');
}
請參閱Pull Request#51435,
了解該方法如何在命令早期失敗的其他幾種現有方法中發(fā)揮作用的實現細節(jié)和示例。
使用make:mail創(chuàng)建刀片視圖
Ryan Chandler為make:mail命令提供了--view標志,
該命令將創(chuàng)建一個空的Blade文件,并將創(chuàng)建的Mailable配置為默認使用它。
它的工作方式與現有的--markdown選項相同,
并省去了創(chuàng)建和連接Blade郵件模板的手動步驟。
php artisan make:mail OrderShipped --view=mail.orders.shipped
發(fā)布說明
你可以在下面看到新功能和更新的完整列表,以及GitHub上11.7.0和11.8.0之間的差異。
以下發(fā)行說明直接來自更改日志:
https://github.com/laravel/framework/compare/v11.7.0...v11.8.0
https://github.com/laravel/framework/blob/12ba04314846a828dbed0bfebb85c4e148d370da/CHANGELOG.md#v1180---2024-05-21
v11.8.0
[11.x]在中通過@foremtehan更新PendingRequest.php
https://github.com/laravel/framework/pull/51338
在中通過@timkelty將unshift方法添加到Collection
https://github.com/laravel/framework/pull/51344
[11.x]通過@dvlpr91將緩存配置文件與更新的laravel v11.0.7同步
https://github.com/laravel/framework/pull/51336
[11.x]在中使用空安全運算符而不是@saMahmoudzadeh的條件檢查
https://github.com/laravel/framework/pull/51328
[11.x]添加要在模型上顯示的事件:show命令由@WendellAdriel在
https://github.com/laravel/framework/pull/51324
[11.x]修復:刪除@calebdw對Redis:COMPRESSION_ZSTD_MIN的使用
https://github.com/laravel/framework/pull/51346
[10.x]Backport:修復SesV2Transport中@Tietew使用正確的EmailTags參數的問題
https://github.com/laravel/framework/pull/51352
[11.x]壯舉:通過@calebdw在ci中使用phpredis 6
https://github.com/laravel/framework/pull/51347
[11.x]在中通過@browner12創(chuàng)建新的“has”驗證規(guī)則
https://github.com/laravel/framework/pull/51348
[11.x]在@Krisell的簽名URL驗證中添加對以前應用程序密鑰的支持
https://github.com/laravel/framework/pull/51222
[11.x]允許在migrate:status中設置退出代碼--由中的@brecht-vermeersch掛起
https://github.com/laravel/framework/pull/51341
[11.x]修復中@erik-perri的數組規(guī)則typehint
https://github.com/laravel/framework/pull/51372
[11.x]@crynobone在中的測試改進
https://github.com/laravel/framework/pull/51365
[10.x]在中通過@staudenmeir修復PHPDoc拼寫錯誤
https://github.com/laravel/framework/pull/51390
[11.x]修復了@philbates35在中resolveRouteBindingQuery的返回類型提示
https://github.com/laravel/framework/pull/51392
[11.x]允許通過@mrthito在bootstrap/app.php中為web和api路由添加數組或字符串
https://github.com/laravel/framework/pull/51356
[11.x]增加了通過@ProjektGopher從handle()方法外部手動使命令失敗的能力
https://github.com/laravel/framework/pull/51435
[10.x]在中通過@faissaloux修復非ASCII字符上的apa
https://github.com/laravel/framework/pull/51428
[11.x]通過中的@chady比較getColumnType中小寫的列名
https://github.com/laravel/framework/pull/51431
[11.x]中@crynobone對resolveRouteBindingQuery()使用協定而不是具體類型
https://github.com/laravel/framework/pull/51425
[11.x]在宏閉包中通過@simonwelsh設置$this的值
https://github.com/laravel/framework/pull/51401
[11.x]在中通過@u01jmg3添加缺少的循環(huán)傳輸驅動程序配置
https://github.com/laravel/framework/pull/51400
[11.x]在中通過@saMahmoudzadeh刪除未使用的命名空間
https://github.com/laravel/framework/pull/51436
[11.x]通過@saMahmoudzadeh在Connector.php中修復文檔塊
https://github.com/laravel/framework/pull/51440
[10.x]修復了@nunomaduro在中查看引擎解析器泄漏內存的問題
https://github.com/laravel/framework/pull/51450
[11.x]在中通過@saMahmoudzadeh向SupportStrTest添加一些測試
https://github.com/laravel/framework/pull/51437
[11.x]在中添加isCurrentlyOwnedBy函數以由@gazben鎖定
https://github.com/laravel/framework/pull/51393
[11.x]通過@bert-w in進行的收集平均值/平均值優(yōu)化
https://github.com/laravel/framework/pull/51512
[11.x]在中介紹@xurshudyan處理丟失的Mix清單的MixManifestNotFoundException
https://github.com/laravel/framework/pull/51502
[11.x]MailMakeCommand:在中添加@ryangjchandler的新--view選項
https://github.com/laravel/framework/pull/51411
[11.x]在中通過@stefanvdlugt構建URL時,將所有支持的枚舉替換為值
https://github.com/laravel/framework/pull/51524
[10.x]在中@rodrigopedra不要在ViewServiceProvider上使用應用程序()Foundation助手
https://github.com/laravel/framework/pull/51522
修復了中@crynobone與BackedEnum的顯式路由綁定
https://github.com/laravel/framework/pull/51525
[11.x]在中通過@hjanos bc向UrlGenerator合同文檔塊添加查詢方法
https://github.com/laravel/framework/pull/51515
轉:
https://laravel-news.com/laravel-11-8-0
123 在
Clash for Windows作者刪庫跑路了,github已404中評論 按理說只要你在國內,所有的流量進出都在監(jiān)控范圍內,不管你怎么隱藏也沒用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最簡單的方法中評論 好久好久都沒看友情鏈接申請了,今天剛看,已經添加。..博主 在
佛跳墻vpn軟件不會用?上不了網?佛跳墻vpn常見問題以及解決辦法中評論 @1111老鐵這個不行了,可以看看近期評論的其他文章..1111 在
佛跳墻vpn軟件不會用?上不了網?佛跳墻vpn常見問題以及解決辦法中評論 網站不能打開,博主百忙中能否發(fā)個APP下載鏈接,佛跳墻或極光..路人 在
php中使用hyperf框架調用訊飛星火大模型實現國內版chatgpt功能示例中評論 教程很詳細,如果加個前端chatgpt對話頁面就完美了..
Copyright·? 2019 侯體宗版權所有·
粵ICP備20027696號