pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <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="frdfz5f" 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="lp7vddb" id='uHdpI'><tfoot id='uHdpI'></tfoot><dl id='uHdpI'><fieldset id='uHdpI'></fieldset></dl></div>
                2. 本文介紹了Laravel - 方法 Illuminate\Support\Collection::makeHidden 不存在的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想隱藏列 password &OTP ,包含在 $uses 結(jié)果中.實(shí)際上,這 2 列是 users 表的一部分.我試過如下.但它會產(chǎn)生錯誤 - 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);  
                  

                  推薦答案

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

                  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']);
                  }
                  

                  這仍然不起作用,因?yàn)槟褂?DB::table('users') 而不是 Users::all().

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

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

                  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']);
                  }
                  

                  這篇關(guān)于Laravel - 方法 Illuminate\Support\Collection::makeHidden 不存在的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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準(zhǔn)備好的語句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的訪問被拒絕)
                    <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="zz7fd77" id='loAxs'><tfoot id='loAxs'></tfoot><dl id='loAxs'><fieldset id='loAxs'></fieldset></dl></div>
                            <tfoot id='loAxs'></tfoot>
                            主站蜘蛛池模板: 校服厂家,英伦校服定做工厂,园服生产定制厂商-东莞市艾咪天使校服 | 广州中央空调回收,二手中央空调回收,旧空调回收,制冷设备回收,冷气机组回收公司-广州益夫制冷设备回收公司 | 电镀整流器_微弧氧化电源_高频电解电源_微弧氧化设备厂家_深圳开瑞节能 | 聚合氯化铝厂家-聚合氯化铝铁价格-河南洁康环保科技 | 长沙广告公司|长沙广告制作设计|长沙led灯箱招牌制作找望城湖南锦蓝广告装饰工程有限公司 | J.S.Bach 圣巴赫_高端背景音乐系统_官网 | 烟气换热器_GGH烟气换热器_空气预热器_高温气气换热器-青岛康景辉 | 水稻烘干机,小麦烘干机,大豆烘干机,玉米烘干机,粮食烘干机_巩义市锦华粮食烘干机械制造有限公司 水环真空泵厂家,2bv真空泵,2be真空泵-淄博真空设备厂 | 干式变压器厂_干式变压器厂家_scb11/scb13/scb10/scb14/scb18干式变压器生产厂家-山东科锐变压器有限公司 | 破碎机锤头_合金耐磨锤头_郑州宇耐机械工程技术有限公司 | 插针变压器-家用电器变压器-工业空调变压器-CD型电抗器-余姚市中驰电器有限公司 | 免费分销系统 — 分销商城系统_分销小程序开发 -【微商来】 | 吲哚菁绿衍生物-酶底物法大肠菌群检测试剂-北京和信同通科技发展有限公司 | 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 | 层流手术室净化装修-检验科ICU改造施工-华锐净化工程-特殊科室建设厂家 | 仿真植物|仿真树|仿真花|假树|植物墙 - 广州天昆仿真植物有限公司 | 南溪在线-南溪招聘找工作、找房子、找对象,南溪综合生活信息门户! | 游泳池设备安装工程_恒温泳池设备_儿童游泳池设备厂家_游泳池水处理设备-东莞市君达泳池设备有限公司 | 钢板仓,大型钢板仓,钢板库,大型钢板库,粉煤灰钢板仓,螺旋钢板仓,螺旋卷板仓,骨料钢板仓 | 服务器之家 - 专注于服务器技术及软件下载分享 | 火锅底料批发-串串香技术培训[川禾川调官网] | 液压升降平台_剪叉式液压/导轨式升降机_传菜机定做「宁波日腾升降机厂家」 | 上海软件开发-上海软件公司-软件外包-企业软件定制开发公司-咏熠科技 | 逗网红-抖音网红-快手网红-各大平台网红物品导航 | YAGEO国巨电容|贴片电阻|电容价格|三星代理商-深圳市巨优电子有限公司 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂 | 圆盘鞋底注塑机_连帮鞋底成型注塑机-温州天钢机械有限公司 | 馋嘴餐饮网_餐饮加盟店火爆好项目_餐饮连锁品牌加盟指南创业平台 | 餐饮加盟网_特色餐饮连锁加盟店-餐饮加盟官网 | 铝机箱_铝外壳加工_铝外壳厂家_CNC散热器加工-惠州市铂源五金制品有限公司 | 蜘蛛车-高空作业平台-升降机-高空作业车租赁-臂式伸缩臂叉装车-登高车出租厂家 - 普雷斯特机械设备(北京)有限公司 | 焊接减速机箱体,减速机箱体加工-淄博博山泽坤机械厂 | 茶楼装修设计_茶馆室内设计效果图_云臻轩茶楼装饰公司 | 断桥铝破碎机_铝合金破碎机_废铁金属破碎机-河南鑫世昌机械制造有限公司 | 防水接头-电缆防水接头-金属-电缆密封接头-不锈钢电缆接头 | 全国冰箱|空调|洗衣机|热水器|燃气灶维修服务平台-百修家电 | Magnescale探规,Magnescale磁栅尺,Magnescale传感器,Magnescale测厚仪,Mitutoyo光栅尺,笔式位移传感器-苏州连达精密量仪有限公司 | 哈希PC1R1A,哈希CA9300,哈希SC4500-上海鑫嵩实业有限公司 | 火锅加盟_四川成都火锅店加盟_中国火锅连锁品牌十强_朝天门火锅【官网】 | 低粘度纤维素|混凝土灌浆料|有机硅憎水粉|聚羧酸减水剂-南京斯泰宝 | 陕西视频监控,智能安防监控,安防系统-西安鑫安5A安防工程公司 |