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

  • <legend id='gx8RI'><style id='gx8RI'><dir id='gx8RI'><q id='gx8RI'></q></dir></style></legend>

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

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

        Laravel 在數(shù)據(jù)透視表中雄辯的 UUID

        Laravel eloquent UUID in a pivot table(Laravel 在數(shù)據(jù)透視表中雄辯的 UUID)
        • <bdo id='ZgDRd'></bdo><ul id='ZgDRd'></ul>
        • <tfoot id='ZgDRd'></tfoot>
          • <legend id='ZgDRd'><style id='ZgDRd'><dir id='ZgDRd'><q id='ZgDRd'></q></dir></style></legend>

            1. <small id='ZgDRd'></small><noframes id='ZgDRd'>

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

                  本文介紹了Laravel 在數(shù)據(jù)透視表中雄辯的 UUID的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  這個問題是這樣的:laravel uuid 未顯示在查詢中.然而,這個問題的不同之處在于該表是一個帶有 id 字段的數(shù)據(jù)透視表,使用通過 MySQL 觸發(fā)器在插入時生成的 UUID.

                  This question is like this one: laravel uuid not showing in query. However, the difference in this question is about that table is a pivot table with id field uses UUID generated via MySQL trigger on insert.

                  我不想為該數(shù)據(jù)透視表創(chuàng)建另一個模型來為其提供類似問題的答案所考慮的解決方案.那么,有沒有什么辦法可以從與之相關(guān)的另一個模型中對數(shù)據(jù)透視表進(jìn)行類型轉(zhuǎn)換?

                  I don't want to create another model for that pivot table to supply it with the solution regarded on the similar question's answer. So, is there any way to perform type casting of the pivot table from another model related to it?

                  推薦答案

                  我想這可能是你想要的:

                  I think this might be what you want:

                  在定義 BelongsToMany 關(guān)系的模型中添加此屬性:

                  In your model that defines the BelongsToMany relationship add this property:

                  protected $casts = ['relationName.pivot.id' => 'string'];
                  

                  更新

                  我想我們可以在這里使用 php7.0 中的匿名類,而不是為樞軸創(chuàng)建模型類:

                  I guess we can make use of anonymous classes in php7.0 here instead of creating a model class for the pivot:

                  我沒有測試這段代碼,所以我不知道它是否有效,這只是一個想法

                  public function activeStatuses()
                  {
                      return $this->belongsToMany('ModelName')
                                  ->using(class_basename(new class extends IlluminateDatabaseEloquentRelationsPivot {
                                      protected $casts = ['id' => 'string'];
                                  }));
                  }
                  

                  通常我更愿意為數(shù)據(jù)透視表創(chuàng)建模型或簡單地使用數(shù)據(jù)透視類

                  Generally i would prefer to create model for the pivot table or simply use a pivot class

                  這篇關(guān)于Laravel 在數(shù)據(jù)透視表中雄辯的 UUID的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                    <legend id='WLIz0'><style id='WLIz0'><dir id='WLIz0'><q id='WLIz0'></q></dir></style></legend>

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

                            <tbody id='WLIz0'></tbody>

                            <bdo id='WLIz0'></bdo><ul id='WLIz0'></ul>

                            <tfoot id='WLIz0'></tfoot>
                            主站蜘蛛池模板: 亚洲第一成人影院 | 亚洲成人精品 | 国产精品高潮呻吟久久aⅴ码 | 成人免费一区二区三区牛牛 | 中国大陆高清aⅴ毛片 | 日韩视频免费看 | 人人爽日日躁夜夜躁尤物 | 久久精品国产一区 | 国产乱码精品一区二区三区五月婷 | 国产欧美在线 | 亚洲成人网在线播放 | 国产精品午夜电影 | 午夜免费看| 天天夜夜操 | 亚洲有码转帖 | av毛片在线免费观看 | 丝袜久久| 国产精品91久久久久久 | 99国产精品久久久 | 在线欧美小视频 | 久久一二三区 | 久久一区二区视频 | 日韩在线视频一区 | 国产精品视频 | 91国产视频在线 | 中文字幕一区二区三区日韩精品 | 中文字幕一区二区三区乱码图片 | 国产中文字幕在线 | 99综合| 欧美成人精品一区 | 亚洲精品一二区 | 噜久寡妇噜噜久久寡妇 | 国产成人精品av | 亚洲欧美精品在线观看 | 亚洲成人免费av | 羞羞视频免费观看 | 一级片在线免费播放 | 五月激情婷婷在线 | 日韩午夜影院 | 亚洲喷水 | 91国产精品在线 |