original_string: public function forget($key)
      {
          $keyExp = explode('.', $key);
  
          // get settings value by first key name
          $query = $this->database
              ->table($this->config['db_table'])
              ->where('setting_key', $keyExp[0]);
  
          $row = $query->first(['setting_value']);
  
          if ( ! is_null($row))
          {
              if (count($keyExp) > 1)
              {
                  // if found more keys, then forget last key from array
                  $setting_value = json_decode($row->setting_value, true);
  
                  unset($keyExp[0]);
                  $newKey = implode('.', $keyExp);
  
                  Arr::forget($setting_value, $newKey);
  
  
                  if (count($setting_value) > 0)
                  {
                      // if we still have settings, update settings row
                      $query->update(['setting_value' => json_encode($setting_value)]);
                  }
                  else
                  {
                      // if settings value remain blank, delete settings row
                      $query->delete();
                  }
              }
              else
              {
                  // if found only one key, delete settings row
                  $query->delete();
              }
          }
  
          $this->cache->forget($key);
      }
code: public function forget($key)
      {
          $keyExp = explode('.', $key);
  
          // get settings value by first key name
          $query = $this->database
              ->table($this->config['db_table'])
              ->where('setting_key', $keyExp[0]);
  
          $row = $query->first(['setting_value']);
  
          if ( ! is_null($row))
          {
              if (count($keyExp) > 1)
              {
                  // if found more keys, then forget last key from array
                  $setting_value = json_decode($row->setting_value, true);
  
                  unset($keyExp[0]);
                  $newKey = implode('.', $keyExp);
  
                  Arr::forget($setting_value, $newKey);
  
  
                  if (count($setting_value) > 0)
                  {
                      // if we still have settings, update settings row
                      $query->update(['setting_value' => json_encode($setting_value)]);
                  }
                  else
                  {
                      // if settings value remain blank, delete settings row
                      $query->delete();
                  }
              }
              else
              {
                  // if found only one key, delete settings row
                  $query->delete();
              }
          }
  
          $this->cache->forget($key);
      }
code_tokens: public function forget ( $ key ) { $ keyExp = explode ( '.' , $ key ) ; // get settings value by first key name $ query = $ this -> database -> table ( $ this -> config [ 'db_table' ] ) -> where ( 'setting_key' , $ keyExp [ 0 ] ) ; $ row = $ query -> first ( [ 'setting_value' ] ) ; if ( ! is_null ( $ row ) ) { if ( count ( $ keyExp ) > 1 ) { // if found more keys, then forget last key from array $ setting_value = json_decode ( $ row -> setting_value , true ) ; unset ( $ keyExp [ 0 ] ) ; $ newKey = implode ( '.' , $ keyExp ) ; Arr :: forget ( $ setting_value , $ newKey ) ; if ( count ( $ setting_value ) > 0 ) { // if we still have settings, update settings row $ query -> update ( [ 'setting_value' => json_encode ( $ setting_value ) ] ) ; } else { // if settings value remain blank, delete settings row $ query -> delete ( ) ; } } else { // if found only one key, delete settings row $ query -> delete ( ) ; } } $ this -> cache -> forget ( $ key ) ; }
docstring: Remove a settings from database and cache file
  
  @param  string $key
  
  @return void
docstring_tokens: Remove a settings from database and cache file