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

    <small id='1d8tX'></small><noframes id='1d8tX'>

      <bdo id='1d8tX'></bdo><ul id='1d8tX'></ul>
    1. <tfoot id='1d8tX'></tfoot>

      <legend id='1d8tX'><style id='1d8tX'><dir id='1d8tX'><q id='1d8tX'></q></dir></style></legend>
      <i id='1d8tX'><tr id='1d8tX'><dt id='1d8tX'><q id='1d8tX'><span id='1d8tX'><b id='1d8tX'><form id='1d8tX'><ins id='1d8tX'></ins><ul id='1d8tX'></ul><sub id='1d8tX'></sub></form><legend id='1d8tX'></legend><bdo id='1d8tX'><pre id='1d8tX'><center id='1d8tX'></center></pre></bdo></b><th id='1d8tX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1d8tX'><tfoot id='1d8tX'></tfoot><dl id='1d8tX'><fieldset id='1d8tX'></fieldset></dl></div>
      1. Laravel - 方法 Illuminate\Support\Collection::makeHidden 不

        Laravel - Method Illuminate\Support\Collection::makeHidden does not exist(Laravel - 方法 Illuminate\Support\Collection::makeHidden 不存在)
        <legend id='uHdpI'><style id='uHdpI'><dir id='uHdpI'><q id='uHdpI'></q></dir></style></legend><tfoot id='uHdpI'></tfoot>
          <bdo id='uHdpI'></bdo><ul id='uHdpI'></ul>

                    <tbody id='uHdpI'></tbody>
                1. <small id='uHdpI'></small><noframes id='uHdpI'>

                  <i id='uHdpI'><tr id='uHdpI'><dt id='uHdpI'><q id='uHdpI'><span id='uHdpI'><b id='uHdpI'><form id='uHdpI'><ins id='uHdpI'></ins><ul id='uHdpI'></ul><sub id='uHdpI'></sub></form><legend id='uHdpI'></legend><bdo id='uHdpI'><pre id='uHdpI'><center id='uHdpI'></center></pre></bdo></b><th id='uHdpI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uHdpI'><tfoot id='uHdpI'></tfoot><dl id='uHdpI'><fieldset id='uHdpI'></fieldset></dl></div>
                2. 本文介紹了Laravel - 方法 Illuminate\Support\Collection::makeHidden 不存在的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想隱藏列 password &OTP ,包含在 $uses 結果中.實際上,這 2 列是 users 表的一部分.我試過如下.但它會產生錯誤 - Method Illuminate\Support\Collection::makeHidden does not exist .如何解決這個問題?任何建議..

                  I want to hide the columns password & OTP ,that is included in $uses result. Actually these 2 columns are part of the users table. I've tried like below. But it generates the error - Method Illuminate\Support\Collection::makeHidden does not exist . How to solve this? Any suggestions..

                  $users = DB::table('users')
                              ->join('location', 'users.id', '=', 'location.id')
                              ->join('user_technical_details', 'users.id', '=', 'user_technical_details.id')
                              ->get();
                  $d=$users->makeHidden(['password','OTP']);    
                  return response()->json([
                              'message' => 'profile viewed successfully',
                              'data' => $d,
                              'statusCode' => 200,
                              'status' => 'success'],200);  
                  

                  推薦答案

                  您正在嘗試在集合上執行此方法,但它是一個模型方法:

                  You're trying to execute this method on the collection but it's a model method:

                  $users = DB::table('users')
                              ->join('location', 'users.id', '=', 'location.id')
                              ->join('user_technical_details', 'users.id', '=', 'user_technical_details.id')
                              ->get();
                  foreach($users as $user) {
                      $user->makeHidden(['password','OTP']);
                  }
                  

                  這仍然不起作用,因為您使用 DB::table('users') 而不是 Users::all().

                  And this still doesn't work since you're using DB::table('users') over Users::all().

                  為了使用模型,您必須執行以下操作:

                  In order to use a model, you have to do the following:

                  型號:

                  class User extends Model
                  {
                      // Instead of `makeHidden()` you can do this if you want them always to be hidden
                      // protected $hidden = ['password','OTP'];
                  
                      public function location()
                      {
                          return $this->hasOne(AppModelsLocation::class, 'users.id', '=', 'location.id');
                      }
                  
                      public function technical_details()
                      {
                          return $this->hasOne(AppModelsUserTechnicalDetail::class, 'users.id', '=', 'user_technical_details.id');
                      }
                  }
                  

                  控制器:

                  $users = Users::with(['location', 'technical_details'])
                              ->get();
                  foreach($users as $user) {
                      $user->makeHidden(['password','OTP']);
                  }
                  

                  這篇關于Laravel - 方法 Illuminate\Support\Collection::makeHidden 不存在的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

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

                              <tbody id='loAxs'></tbody>

                          • <i id='loAxs'><tr id='loAxs'><dt id='loAxs'><q id='loAxs'><span id='loAxs'><b id='loAxs'><form id='loAxs'><ins id='loAxs'></ins><ul id='loAxs'></ul><sub id='loAxs'></sub></form><legend id='loAxs'></legend><bdo id='loAxs'><pre id='loAxs'><center id='loAxs'></center></pre></bdo></b><th id='loAxs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='loAxs'><tfoot id='loAxs'></tfoot><dl id='loAxs'><fieldset id='loAxs'></fieldset></dl></div>
                            <tfoot id='loAxs'></tfoot>
                            主站蜘蛛池模板: 久久伊人精品一区二区三区 | 欧美日韩国产一区二区三区 | 四虎影院在线播放 | 日日日视频 | 91精品国产91久久综合桃花 | 在线播放中文字幕 | 成人在线视频网站 | 精品乱码一区二区三四区 | 9999久久 | 久久久久九九九女人毛片 | 日日干日日操 | www成人免费视频 | 91成人小视频 | 福利视频一区二区 | 色婷婷一区二区三区四区 | 五月综合激情在线 | 91精品国产欧美一区二区成人 | 久久久久国 | 色婷婷综合网站 | 国产精品久久久久久吹潮 | 欧美精品欧美精品系列 | 97视频在线免费 | 91久久久www播放日本观看 | 日韩在线一区二区三区 | 国产成人综合一区二区三区 | 福利片在线观看 | 亚洲 中文 欧美 日韩 在线观看 | 中文字幕在线一 | 色综合久久天天综合网 | 欧美乱操 | 久久国产精品网 | 日韩综合在线播放 | 黑人久久 | 国产乱性| 欧美日本一区二区 | 日韩一区二区在线免费观看 | 日韩精品人成在线播放 | 亚洲第一天堂 | 一区二区三区在线 | 午夜在线免费观看视频 | 精品一级电影 |