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);
        }
    }
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);
        }
    }
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 ) ; } }
Updates a setting value.

@param string      $name
@param string|null $value

@throws \CachetHQ\Cachet\Settings\WriteException

@return void
Updates a setting value .