original_string: public function store(Model $model, array $data)
      {
          if ( ! config('cms-models.transactions')) {
              return $this->storeFormFieldValuesForModel($model, $data);
          }
  
          // Perform the whole store process in a transaction
          DB::beginTransaction();
  
          try {
  
              $success = $this->storeFormFieldValuesForModel($model, $data);
  
              if ($success) {
                  DB::commit();
              } else {
                  DB::rollBack();
              }
  
          } catch (Exception $e) {
  
              DB::rollBack();
  
              throw $e;
          }
  
          return $success;
      }
code: public function store(Model $model, array $data)
      {
          if ( ! config('cms-models.transactions')) {
              return $this->storeFormFieldValuesForModel($model, $data);
          }
  
          // Perform the whole store process in a transaction
          DB::beginTransaction();
  
          try {
  
              $success = $this->storeFormFieldValuesForModel($model, $data);
  
              if ($success) {
                  DB::commit();
              } else {
                  DB::rollBack();
              }
  
          } catch (Exception $e) {
  
              DB::rollBack();
  
              throw $e;
          }
  
          return $success;
      }
code_tokens: public function store ( Model $ model , array $ data ) { if ( ! config ( 'cms-models.transactions' ) ) { return $ this -> storeFormFieldValuesForModel ( $ model , $ data ) ; } // Perform the whole store process in a transaction DB :: beginTransaction ( ) ; try { $ success = $ this -> storeFormFieldValuesForModel ( $ model , $ data ) ; if ( $ success ) { DB :: commit ( ) ; } else { DB :: rollBack ( ) ; } } catch ( Exception $ e ) { DB :: rollBack ( ) ; throw $ e ; } return $ success ; }
docstring: Stores submitted form field data on a model.
  
  @param Model $model
  @param array $data
  @return bool
  @throws Exception
docstring_tokens: Stores submitted form field data on a model .