久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='2GLsC'><style id='2GLsC'><dir id='2GLsC'><q id='2GLsC'></q></dir></style></legend>
  • <tfoot id='2GLsC'></tfoot>

    <small id='2GLsC'></small><noframes id='2GLsC'>

        <bdo id='2GLsC'></bdo><ul id='2GLsC'></ul>
    1. <i id='2GLsC'><tr id='2GLsC'><dt id='2GLsC'><q id='2GLsC'><span id='2GLsC'><b id='2GLsC'><form id='2GLsC'><ins id='2GLsC'></ins><ul id='2GLsC'></ul><sub id='2GLsC'></sub></form><legend id='2GLsC'></legend><bdo id='2GLsC'><pre id='2GLsC'><center id='2GLsC'></center></pre></bdo></b><th id='2GLsC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2GLsC'><tfoot id='2GLsC'></tfoot><dl id='2GLsC'><fieldset id='2GLsC'></fieldset></dl></div>

        json 資源和 json 資源有什么區(qū)別?資源收集?在 La

        What is the difference between a json resource amp; resource collection? in Laravel(json 資源和 json 資源有什么區(qū)別?資源收集?在 Laravel)
          <legend id='mb8Zq'><style id='mb8Zq'><dir id='mb8Zq'><q id='mb8Zq'></q></dir></style></legend>

                <bdo id='mb8Zq'></bdo><ul id='mb8Zq'></ul>
                  <tbody id='mb8Zq'></tbody>
                <tfoot id='mb8Zq'></tfoot>

              • <i id='mb8Zq'><tr id='mb8Zq'><dt id='mb8Zq'><q id='mb8Zq'><span id='mb8Zq'><b id='mb8Zq'><form id='mb8Zq'><ins id='mb8Zq'></ins><ul id='mb8Zq'></ul><sub id='mb8Zq'></sub></form><legend id='mb8Zq'></legend><bdo id='mb8Zq'><pre id='mb8Zq'><center id='mb8Zq'></center></pre></bdo></b><th id='mb8Zq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mb8Zq'><tfoot id='mb8Zq'></tfoot><dl id='mb8Zq'><fieldset id='mb8Zq'></fieldset></dl></div>
                • <small id='mb8Zq'></small><noframes id='mb8Zq'>

                  本文介紹了json 資源和 json 資源有什么區(qū)別?資源收集?在 Laravel的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  誰能解釋一下 ResourceCollection 和 JsonResource 之間的區(qū)別?

                  Can someone explain the difference between a ResourceCollection and JsonResource?

                  在 Laravel 6 文檔中,您可以生成 2 種不同類型的資源……ResourceCollection 和 JsonResource.https://laravel.com/docs/6.x/eloquent-resources#resource-responses

                  In Laravel 6 docs you can generate 2 different types of resources... ResourceCollection and JsonResource. https://laravel.com/docs/6.x/eloquent-resources#resource-responses

                  <?php
                  
                  namespace AppHttpResources;
                  
                  use IlluminateHttpResourcesJsonResourceCollection;
                  
                  class ShopCollection extends ResourceCollection
                  {
                      /**
                       * Transform the resource collection into an array.
                       *
                       * @param  IlluminateHttpRequest  $request
                       * @return array
                       */
                      public function toArray($request)
                      {
                          return parent::toArray($request);
                      }
                  }
                  
                  

                  對...

                  <?php
                  
                  namespace AppHttpResources;
                  
                  use IlluminateHttpResourcesJsonJsonResource;
                  
                  class Shop extends JsonResource
                  {
                      /**
                       * Transform the resource into an array.
                       *
                       * @param  IlluminateHttpRequest  $request
                       * @return array
                       */
                      public function toArray($request)
                      {
                          return parent::toArray($request);
                      }
                  }
                  

                  推薦答案

                  當你將單個模型轉(zhuǎn)換為 json 時,即為 json 資源,當你將模型集合轉(zhuǎn)換為 json 時,即為資源集合.

                  When you are converting a single model to json, that is a json resource, when you are converting a collection of model to json, that is resource collection.

                  簡單來說,如果您要返回資源集合或作為集合的分頁響應(yīng).

                  simply If you are returning a collection of resources or a paginated response that is a collection.

                  請參閱文檔

                  要生成轉(zhuǎn)換單個模型的資源,您可以生成負責轉(zhuǎn)換集合的資源模型.這允許您的響應(yīng)包含鏈接和其他元與給定的整個集合相關(guān)的信息資源.

                  to generating resources that transform individual models, you may generate resources that are responsible for transforming collections of models. This allows your response to include links and other meta information that is relevant to an entire collection of a given resource.

                  這篇關(guān)于json 資源和 json 資源有什么區(qū)別?資源收集?在 Laravel的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環(huán))
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務(wù)器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數(shù))
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結(jié)果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“l(fā)ocalhost的訪問被拒絕)

                  <small id='zSp6c'></small><noframes id='zSp6c'>

                    <tbody id='zSp6c'></tbody>

                • <i id='zSp6c'><tr id='zSp6c'><dt id='zSp6c'><q id='zSp6c'><span id='zSp6c'><b id='zSp6c'><form id='zSp6c'><ins id='zSp6c'></ins><ul id='zSp6c'></ul><sub id='zSp6c'></sub></form><legend id='zSp6c'></legend><bdo id='zSp6c'><pre id='zSp6c'><center id='zSp6c'></center></pre></bdo></b><th id='zSp6c'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zSp6c'><tfoot id='zSp6c'></tfoot><dl id='zSp6c'><fieldset id='zSp6c'></fieldset></dl></div>
                    <tfoot id='zSp6c'></tfoot>

                      <bdo id='zSp6c'></bdo><ul id='zSp6c'></ul>
                        1. <legend id='zSp6c'><style id='zSp6c'><dir id='zSp6c'><q id='zSp6c'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 欧美不卡视频 | 91视频电影 | 91免费在线播放 | 一本色道精品久久一区二区三区 | 国产欧美精品一区二区色综合朱莉 | 欧美一级片中文字幕 | 中文字幕高清视频 | 91精品国产91久久久久久密臀 | 欧美美女一区二区 | 成人国产在线观看 | 成人在线视频一区二区三区 | 日韩h | 国产一级网站 | 一区二区三区视频免费观看 | 国产一区二区三区在线看 | 精品中文在线 | 国产激情在线 | 日韩色在线 | 亚洲一区二区三区四区五区中文 | 在线观看欧美日韩视频 | 国产第一页在线播放 | 成人午夜免费视频 | 国产在线播 | 欧美一级二级三级视频 | 亚洲欧美一区二区三区1000 | 91精品国产综合久久国产大片 | 久久久久久久一区 | 中文字幕伊人 | 久久男人 | 国内精品伊人久久久久网站 | 91视频亚洲| 在线成人免费观看 | 一级黄色毛片 | 成人在线小视频 | 久久9视频| 91网站视频在线观看 | 性高湖久久久久久久久 | 国产一区二区三区网站 | 日韩激情在线 | 综合色久 | 国内久久|