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

  • <small id='2GIyM'></small><noframes id='2GIyM'>

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

      <bdo id='2GIyM'></bdo><ul id='2GIyM'></ul>

    1. <legend id='2GIyM'><style id='2GIyM'><dir id='2GIyM'><q id='2GIyM'></q></dir></style></legend>
      1. Laravel 5.5 對具有不同列名的單獨表的唯一驗證規

        Laravel 5.5 unique validation rule on seperate table with different column name(Laravel 5.5 對具有不同列名的單獨表的唯一驗證規則)
          <i id='WVsGu'><tr id='WVsGu'><dt id='WVsGu'><q id='WVsGu'><span id='WVsGu'><b id='WVsGu'><form id='WVsGu'><ins id='WVsGu'></ins><ul id='WVsGu'></ul><sub id='WVsGu'></sub></form><legend id='WVsGu'></legend><bdo id='WVsGu'><pre id='WVsGu'><center id='WVsGu'></center></pre></bdo></b><th id='WVsGu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WVsGu'><tfoot id='WVsGu'></tfoot><dl id='WVsGu'><fieldset id='WVsGu'></fieldset></dl></div>
          <legend id='WVsGu'><style id='WVsGu'><dir id='WVsGu'><q id='WVsGu'></q></dir></style></legend>

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

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

                • <tfoot id='WVsGu'></tfoot>
                    <tbody id='WVsGu'></tbody>

                • 本文介紹了Laravel 5.5 對具有不同列名的單獨表的唯一驗證規則的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  所以我有用戶和公司.一個用戶屬于一個公司.

                  So I have users and companies. A user belongs to one company.

                  我想驗證用戶注冊,以便他們用來注冊的 business_name 字段在 companys 表中是唯一的,目標是不允許用戶創建重復公司.

                  I want to validate a user registration so that the business_name field they use to register is unique in the companies table, the goal is to not allow users from creating duplicate companies.

                  這是我的注冊函數:

                  public function register(Request $request)
                      {
                          $validator = Validator::make($request->all(), [
                              'first_name' => 'required',
                              'last_name' => 'required',
                              'business_name' => 'required|unique:companies',
                              'email' => 'required|email|max:255|unique:users',
                              'password' => 'required|min:6',
                          ]);
                  
                  
                          if ($validator->fails()) {
                              return response()->json(['error'=>$validator->messages()], 401);
                          }
                  
                  }
                  

                  我要比較的字段是用于檢查唯一性的 companies.name.

                  The field I want to compare against is the companies.name to check for uniqueness.

                  這可能嗎?目前它正在嘗試在 companys 表中查找 business_name.

                  Is this possible? At the moment it is trying to look for business_name in the companies table.

                  推薦答案

                  沒關系,設法弄明白了.只需要一個額外的參數來指定列名:

                  Never mind, managed to figure it out. Just needed an extra parameter to specify the column name:

                  'business_name' => 'required|unique:companies,name',
                  

                  這篇關于Laravel 5.5 對具有不同列名的單獨表的唯一驗證規則的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

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

                        <tfoot id='tdCpl'></tfoot>
                          <tbody id='tdCpl'></tbody>
                      1. <legend id='tdCpl'><style id='tdCpl'><dir id='tdCpl'><q id='tdCpl'></q></dir></style></legend>

                          <bdo id='tdCpl'></bdo><ul id='tdCpl'></ul>
                          • 主站蜘蛛池模板: a级大片免费观看 | 国产三级网站 | 我我色综合 | 精品国产第一区二区三区 | 国产精品久久久久久久久久久久冷 | 国产99久久 | 国产成人免费在线 | 久久久精品综合 | 精品一区二区三区在线观看 | 国产视频1区2区 | 亚洲一区 中文字幕 | 一区二区在线不卡 | 亚洲午夜电影 | 91原创视频在线观看 | 亚洲精品高清视频 | 亚洲精品乱码久久久久久9色 | 国产探花在线精品一区二区 | 日韩福利 | 亚洲看片网站 | 免费一级黄色电影 | 亚洲精品麻豆 | av免费观看在线 | 天天夜夜操 | 中文字幕一二三区 | 亚洲精品女人久久久 | 91一区二区 | 婷婷99| 国产一区二区三区在线 | 黄色国产 | 色视频在线免费观看 | 搞黄视频免费看 | 国产精品久久久久久久久久久久久 | 97超碰成人 | 一区二区三区四区国产 | 亚洲精品视 | 亚洲视频精品 | 欧美无乱码久久久免费午夜一区 | 天天天操操操 | 亚洲91精品 | 激情婷婷| 香蕉视频久久久 |