久久久久久久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三级 | 欧美午夜剧场 | 国产美女精品 | av影音资源 | 国产精品一区在线观看 | 中文字幕av网| 亚洲1区 | xnxx 日本免费 | 欧美一级电影免费 | 一区二区三区四区av | 日本欧美在线 | 成人午夜免费在线视频 | 久久国产精品一区 | 91精品久久久久久久久中文字幕 | 亚洲性视频 | 黄网站免费在线 | 岛国毛片在线观看 | 毛片免费看 | 亚洲伦理自拍 | 91精品无人区卡一卡二卡三 | 97久久久久久久久 | 日韩精品一区二区三区在线 | 中文字幕成人在线 | 亚洲成人激情在线观看 | 成人一区在线观看 | 久久久久久成人 | 成人免费在线 | 精品久久久久久亚洲综合网 | 亚洲一区二区三区国产 | 中文字幕乱码一区二区三区 | 精品久久久久久久久久久下田 | 91成人在线 | 综合久久色 | 91精品久久久久久久久久 | 亚洲 中文 欧美 日韩 在线观看 | 国产一区电影 | 国产欧美一区二区三区在线看 |