original_string: public function sync(array $data, array $areas = [])
      {
          DB::beginTransaction();
          try {
              $templates = array_get($data, 'templates', []);
              $model     = $this->storeNotificationInstance($data);
              $langs     = array_get($data, 'languages', []);
              foreach ($langs as $lang) {
                  $this->processSingle($data, $lang, $model);
              }
          } catch (Exception $e) {
              DB::rollback();
              throw $e;
          }
          DB::commit();
          return true;
      }
code: public function sync(array $data, array $areas = [])
      {
          DB::beginTransaction();
          try {
              $templates = array_get($data, 'templates', []);
              $model     = $this->storeNotificationInstance($data);
              $langs     = array_get($data, 'languages', []);
              foreach ($langs as $lang) {
                  $this->processSingle($data, $lang, $model);
              }
          } catch (Exception $e) {
              DB::rollback();
              throw $e;
          }
          DB::commit();
          return true;
      }
code_tokens: public function sync ( array $ data , array $ areas = [ ] ) { DB :: beginTransaction ( ) ; try { $ templates = array_get ( $ data , 'templates' , [ ] ) ; $ model = $ this -> storeNotificationInstance ( $ data ) ; $ langs = array_get ( $ data , 'languages' , [ ] ) ; foreach ( $ langs as $ lang ) { $ this -> processSingle ( $ data , $ lang , $ model ) ; } } catch ( Exception $ e ) { DB :: rollback ( ) ; throw $ e ; } DB :: commit ( ) ; return true ; }
docstring: Stores system notifications
  
  @param array $data
  @param array $areas
  @throws Exception
docstring_tokens: Stores system notifications