Hash::make($value), ); } function checkPasswd($iUid,$sPasswd):bool { $oUser = $this->where('id',$iUid)->first(); if(empty($oUser)) return false; return Hash::check($sPasswd,$oUser->password); } function addUser($aItem): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder|bool { // if(isset($aItem['password']) && !empty($aItem['password'])) $aItem['password'] = Hash::make($aItem['password']); return $this->addItem($aItem); } function findItemByUsername($sUsername,$col=['*']): \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Builder|array|null { return $this->newQuery()->where('username',$sUsername)->first($col); } function findUserByUidWithCache($iUid): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Builder|array|null { return Cache::remember(RedisConst::ORM_CACHE_USER.$iUid,RedisConst::ORM_FIND_CACHE_SECOND,function ()use ($iUid){ return $this->findItem($iUid); }); } }