where ('account_identity', $uuid)->first ()) ? $ret->toArray () : ''; } public function setUserSettings($uuid, $data) { $us = $this->where ('account_identity', $uuid)->first(); if ($us) { return $this->where('account_identity',$uuid)->update($data); }else{ $data['account_identity'] = $uuid; return $this->insert($data); } } }