original_string: public function put($key, $value)
      {
          // if key exits then override
          if ($this::has($key)) {
              $setting = (new SettingModel)
                  ->cached()
                  ->where('key', $key)
                  ->first();
  
              $setting->value = $value;
  
              return $setting->save();
          }
  
          return SettingModel::create([
              'key' => $key,
              'value' => $value,
          ]);
      }
code: public function put($key, $value)
      {
          // if key exits then override
          if ($this::has($key)) {
              $setting = (new SettingModel)
                  ->cached()
                  ->where('key', $key)
                  ->first();
  
              $setting->value = $value;
  
              return $setting->save();
          }
  
          return SettingModel::create([
              'key' => $key,
              'value' => $value,
          ]);
      }
code_tokens: public function put ( $ key , $ value ) { // if key exits then override if ( $ this :: has ( $ key ) ) { $ setting = ( new SettingModel ) -> cached ( ) -> where ( 'key' , $ key ) -> first ( ) ; $ setting -> value = $ value ; return $ setting -> save ( ) ; } return SettingModel :: create ( [ 'key' => $ key , 'value' => $ value , ] ) ; }
docstring: Store new key and value in settings if it's already
  exits then override.
  
  @param  string $key
  @param  string $value
  @return null
docstring_tokens: Store new key and value in settings if it s already exits then override .