Laravel 11.15版本發(fā)布 - Eloquent Builder中添加的泛型
Laravel  /  管理員 發(fā)布于 8個月前   542
Laravel團隊本周發(fā)布了v11.15,其中包括對make:mail命令的改進、
對使用Resend在附件上設置mime類型的支持、數(shù)據(jù)庫遷移更新等。
在Eloquent Builder和關系中添加泛型
Caleb White將關系泛型集成到Laravel框架中:
泛型在ide中提供了更好的自動補全和智能感知,而不必依賴Larastan通過使用存根將泛型添加到類中。
在框架中使用泛型也使第三方包更容易在其自定義關系上定義內(nèi)部類型。
Caleb一直在為Larastan做出貢獻,現(xiàn)在正在將其整合到框架中,改進Laravel中的靜態(tài)分析!
有關更多詳細信息,請參閱Pull Request#51851。
使用make:mail創(chuàng)建視圖的提示
Christoph Rumpel對make:mail命令進行了更新,該命令提示用戶要創(chuàng)建的視圖類型:
使路由器可錄音
Muhammed Sari在Router類中添加了Tappable特性,允許您編寫以下內(nèi)容:
class RouteRegistrar
{
public function __invoke(Router $router)
{
$router->post('redacted', WebhookController::class)
->name('redacted');
}
}
$router
->tap(new Redacted1Webhooks\RouteRegistrar())
->tap(new Redacted2Webhooks\RouteRegistrar())
// ...
;
// In tests...
protected function defineRoutes($router)
{
$router->tap(new \RedactedWebhooks\RouteRegistrar());
}
數(shù)據(jù)庫遷移更新
Hafez Divandari為SQLite周圍的數(shù)據(jù)庫遷移和其他生活質(zhì)量改進做出了貢獻。
總之,Pull Request#51373引入了以下更新:
將SQLite支持擴展到3.26+
在SQLite上添加和刪除外鍵
在SQLite上添加和刪除主鍵
保持命令的順序
SQLite的藍圖狀態(tài)
重新發(fā)送郵件傳輸中對MIME類型的支持
Jayan Ratna對在可重新發(fā)送郵件類中為附件設置mime類型提供了支持。
此PR添加了withMime()方法,在pull請求中演示如下:
public function attachments(): array
{
return [
Attachment::fromPath('/path/to/file')
->as('name.pdf')
->withMime('application/pdf'),
];
}
發(fā)布說明
您可以在GitHub上看到下面新功能和更新的完整列表,以及11.14.0和11.15.0之間的差異。
以下發(fā)行說明直接來自變更日志:
https://github.com/laravel/framework/compare/v11.14.0...v11.15.0
https://github.com/laravel/framework/blob/68e88bbcee1e9b0b02ca267916ee25f45ab3935c/CHANGELOG.md#v11150---2024-07-09
v11.15.0
[10.x]通過@hafezdivandari在HttpResponseException上設置上一個異常https://github.com/laravel/framework/pull/51986
[11.x]壯舉:通過@calebdw在Eloquent Builder和Relations中添加泛型https://github.com/laravel/framework/pull/51851
將phpstan斷言添加到@johanrosenson的集合isEmpty和isNotEmpty中https://github.com/laravel/framework/pull/51998
[11.x]在@jayanatna的重新發(fā)送郵件傳輸中添加對mime類型的支持https://github.com/laravel/framework/pull/52006
[11.x]壯舉:通過@calebdw在SoftDeletes trait中添加虛擬方法https://github.com/laravel/framework/pull/52001
[11.x]通過@seriquynh修復服務容器文檔塊https://github.com/laravel/framework/pull/52000
[10.x]修復Http::try,使得調(diào)用簽名Http::retry([1,2],throw:false)受throw約束,由@paulyoungnb在https://github.com/laravel/framework/pull/52002
[10.x]在中通過@sunaoka將application_name和字符集設置為PostgreSQL DSN字符串https://github.com/laravel/framework/pull/51985
[11.x]通過@seriquynh修復GeneratorCommand文檔塊https://github.com/laravel/framework/pull/52014
[11.x]通過@hafezdivandari增強數(shù)據(jù)庫遷移https://github.com/laravel/framework/pull/51373
[11.x]通過@Jubeki每晚運行MySQL 9數(shù)據(jù)庫集成測試https://github.com/laravel/framework/pull/52027
[11.x]通過@imanghafoori1增強Migrator類的文檔塊https://github.com/laravel/framework/pull/52033
[11.x]在@seriquynh中為事件調(diào)度器使用nullsafe運算符https://github.com/laravel/framework/pull/52024
[11.x]通過@seriquynh修復PasswordBroker構造函數(shù)docblockhttps://github.com/laravel/framework/pull/52023
[11.x]在@lmottasin中添加測試testMultiplyIazy以確保LazyCollection的乘法方法的懶惰行為https://github.com/laravel/framework/pull/52020
[11.x]允許MultipleInstanceManager擁有@cosmastech的研究創(chuàng)建者https://github.com/laravel/framework/pull/52030
[11.x]通過@cosmastech在中向MultipleInstanceManager添加$config屬性https://github.com/laravel/framework/pull/52028
[11.x]修復了@calebdw在https://github.com/laravel/framework/pull/52037
[11.x]讓路由器可由@mabdullahsari在https://github.com/laravel/framework/pull/52051
[11.x]壯舉:改進Factory泛型,通過@calebdw在HasFactory中添加泛型https://github.com/laravel/framework/pull/52005
[11.x]詢問@christophrumpel在中創(chuàng)建郵件命令的名稱旁邊的視圖https://github.com/laravel/framework/pull/52057
[11.x]添加了@siarheipashkevich為LockTimeoutException的塊方法@throws docblockhttps://github.com/laravel/framework/pull/52063
轉(zhuǎn):
https://laravel-news.com/laravel-11-15-0
123 在
Clash for Windows作者刪庫跑路了,github已404中評論 按理說只要你在國內(nèi),所有的流量進出都在監(jiān)控范圍內(nèi),不管你怎么隱藏也沒用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最簡單的方法中評論 好久好久都沒看友情鏈接申請了,今天剛看,已經(jīng)添加。..博主 在
佛跳墻vpn軟件不會用?上不了網(wǎng)?佛跳墻vpn常見問題以及解決辦法中評論 @1111老鐵這個不行了,可以看看近期評論的其他文章..1111 在
佛跳墻vpn軟件不會用?上不了網(wǎng)?佛跳墻vpn常見問題以及解決辦法中評論 網(wǎng)站不能打開,博主百忙中能否發(fā)個APP下載鏈接,佛跳墻或極光..路人 在
php中使用hyperf框架調(diào)用訊飛星火大模型實現(xiàn)國內(nèi)版chatgpt功能示例中評論 教程很詳細,如果加個前端chatgpt對話頁面就完美了..
Copyright·? 2019 侯體宗版權所有·
粵ICP備20027696號