original_string: public function set($name, $value)
      {
          $this->stale = true;
  
          try {
              if ($value === null) {
                  $this->model->where('name', '=', $name)->delete();
              } else {
                  $this->model->updateOrCreate(compact('name'), compact('value'));
              }
          } catch (Exception $e) {
              throw new WriteException($e);
          }
      }
code: public function set($name, $value)
      {
          $this->stale = true;
  
          try {
              if ($value === null) {
                  $this->model->where('name', '=', $name)->delete();
              } else {
                  $this->model->updateOrCreate(compact('name'), compact('value'));
              }
          } catch (Exception $e) {
              throw new WriteException($e);
          }
      }
code_tokens: public function set ( $ name , $ value ) { $ this -> stale = true ; try { if ( $ value === null ) { $ this -> model -> where ( 'name' , '=' , $ name ) -> delete ( ) ; } else { $ this -> model -> updateOrCreate ( compact ( 'name' ) , compact ( 'value' ) ) ; } } catch ( Exception $ e ) { throw new WriteException ( $ e ) ; } }
docstring: Updates a setting value.
  
  @param string      $name
  @param string|null $value
  
  @throws \CachetHQ\Cachet\Settings\WriteException
  
  @return void
docstring_tokens: Updates a setting value .