久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Laravel 9.35 發(fā)布啦!看看都有哪些新變化?

      下面由Laravel教程欄目給大家介紹關(guān)于最新發(fā)布的Laravel 9.35版本都有哪些變化,希望對大家有所幫助!

      Laravel 團(tuán)隊發(fā)布了9.35版本,它有一個新的令人興奮的備用郵件語法、一個Eloquent的 “嚴(yán)格模式” 功能等。

      備用郵件語法

      Taylor Otwell 通過返回 “指定可郵件內(nèi)容和屬性的精簡對象”,貢獻(xiàn)了一個可郵件語法。

      這是他的一個例子 pull request description:

      namespace AppMail;  use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateMailMailable; use IlluminateMailMailablesAddress; use IlluminateMailMailablesAttachment; use IlluminateMailMailablesContent; use IlluminateMailMailablesEnvelope; use IlluminateQueueSerializesModels;  class InvoicePaid extends Mailable {     use Queueable, SerializesModels;      /**      * 創(chuàng)建一個郵件實例      *      * @return void      */     public function __construct()     {         //     }      /**      * 獲取郵件信封      *      * @return IlluminateMailMailablesEnvelope      */     public function envelope()     {         return new Envelope(             subject: 'Invoice Paid',             cc: [new Address('foo@example.com', 'Example Name')],             tags: [],             metadata: [],         );     }      /**      * 獲取郵件內(nèi)容定義      *      * @return IlluminateMailMailablesContent      */     public function content()     {         return new Content(             view: 'html-view-name',             text: 'text-view-name',         );     }      /**      * 獲取郵件的附件      *      * @return IlluminateMailMailablesAttachment[]      */     public function attachments()     {         return [             Attachment::fromPath('/path/to/file'),         ];     } }
      登錄后復(fù)制

      使用build() 定義郵件的傳統(tǒng)方式不會被刪除。 我喜歡上面的例子是因為使用 PHP 8 的命名參數(shù)更一目了然。

      Eloquent “嚴(yán)格”模式

      Chris Morrell 和 Taylor Otwell 合作開發(fā)了 Eloquent 嚴(yán)格模式,該模式支持以下功能:

      • 沒有延遲加載
      • 分配不可填充屬性時的例外情況
      • 訪問未檢索或不存在的屬性的異常

      要在開發(fā)中使用嚴(yán)格模式,方法是將以下內(nèi)容添加到已注冊服務(wù)提供者的 boot() 方法中:

      Model::shouldBeStrict();
      登錄后復(fù)制

      shouldBeStrict() 方法是啟用以下所有功能的快捷方式:

      Model::preventLazyLoading(); Model::preventSilentlyDiscardingAttributes(); Model::preventsAccessingMissingAttributes();
      登錄后復(fù)制

      使用資源路由加載廢棄模型

      Andrew Brown 提供了使用以下路由語法加載帶有資源路由的廢棄模型的能力:

      // 所有終結(jié)點 Route::resource('users', UserController::class)->withTrashed();  // 僅`顯示` Route::resource('users', UserController::class)->withTrashed(['show']);
      登錄后復(fù)制

      發(fā)行說明

      你可以在GitHub上看到下面完整的新功能和更新列表以及[9.34.0]和9.35.0](github.com/laravel/framework/compa…) 之間的區(qū)別。以下發(fā)行說明直接來自 changelog:

      v9.35.0

      添加

      • 允許為資源路由加載廢棄模型 (#44405)
      • 添加到 Illuminate/Database/Eloquent/Model::shouldBeStrict() 和其他 (#44283)
      • 沒有解析控制器的控制器中間件 (#44516)
      • 選擇可郵寄的語法 (#44462)

      修復(fù)

      • 修復(fù)自引用多對多關(guān)系中的聚合函數(shù)(withSum 等)問題(#44286)
      • 修復(fù)了使用靜態(tài)類屬性作為模板屬性的問題 (#44473)
      • Traversable 在 Enumerate Values 中應(yīng)該優(yōu)先于 JsonSerializable(#44456)
      • 修復(fù)了make:cast --inbound,所以它是一個布爾選項,而不是值 (#44505)

      修改

      • 測試方法。 使用 json_encode 使錯誤消息更具可讀性(#44397)
      • Model::without Timestamps() 返回回調(diào)的返回值 (#44457)
      • 僅在相關(guān)路由上加載廢棄模型(#44478)
      • 向 shouldBlockPhpUpload 函數(shù)添加額外的 PHP 擴(kuò)展 (#44512)
      • 為特別嘈雜的對象注冊 cutInternals casters (#44514)
      • 使用 get 方法訪問應(yīng)用程序區(qū)域設(shè)置 (#44521)
      • 僅返回來自頻道的非空響應(yīng) (09d53ee, 3944a3e)
      • 正確的頻道匹配 (#44531)
      • 遷移郵件組件 (#44527)

      原文地址:https://laravel-news.com/laravel-9-35-0

      譯文地址:https://learnku.com/laravel/t/72658

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號