public function save()
    {
        $bResult = false;
        try {
            if (!empty($this->deleteItems)) {
                $items = explode(',', $this->deleteItems);
                RepeaterTranslation::destroy($items);
            }
            if (count($this->groupFields)) {
                foreach ($this->groupFields as $groupId => $group) {
                    $fields = $group['fields'];
                    $order = $this->defaultOrder[$groupId];

                    $translate_id = 0;
                    foreach ($fields as $field) {
                        if ($translate_id) {
                            $field->setTranslateId($translate_id);
                        }
                        $field->save();
                        $translate_id = $field->getTranslateId();
                    }
                     // update order
                     $translate = RepeaterTranslation::find($translate_id);
                    $translate->order = $order;
                    $translate->save();
                }
            }
            $bResult = true;
        } catch (\Exception $e) {
            //exception handling
        }

        return $bResult;
    }
public function save()
    {
        $bResult = false;
        try {
            if (!empty($this->deleteItems)) {
                $items = explode(',', $this->deleteItems);
                RepeaterTranslation::destroy($items);
            }
            if (count($this->groupFields)) {
                foreach ($this->groupFields as $groupId => $group) {
                    $fields = $group['fields'];
                    $order = $this->defaultOrder[$groupId];

                    $translate_id = 0;
                    foreach ($fields as $field) {
                        if ($translate_id) {
                            $field->setTranslateId($translate_id);
                        }
                        $field->save();
                        $translate_id = $field->getTranslateId();
                    }
                     // update order
                     $translate = RepeaterTranslation::find($translate_id);
                    $translate->order = $order;
                    $translate->save();
                }
            }
            $bResult = true;
        } catch (\Exception $e) {
            //exception handling
        }

        return $bResult;
    }
public function save ( ) { $ bResult = false ; try { if ( ! empty ( $ this -> deleteItems ) ) { $ items = explode ( ',' , $ this -> deleteItems ) ; RepeaterTranslation :: destroy ( $ items ) ; } if ( count ( $ this -> groupFields ) ) { foreach ( $ this -> groupFields as $ groupId => $ group ) { $ fields = $ group [ 'fields' ] ; $ order = $ this -> defaultOrder [ $ groupId ] ; $ translate_id = 0 ; foreach ( $ fields as $ field ) { if ( $ translate_id ) { $ field -> setTranslateId ( $ translate_id ) ; } $ field -> save ( ) ; $ translate_id = $ field -> getTranslateId ( ) ; } // update order $ translate = RepeaterTranslation :: find ( $ translate_id ) ; $ translate -> order = $ order ; $ translate -> save ( ) ; } } $ bResult = true ; } catch ( \ Exception $ e ) { //exception handling } return $ bResult ; }
Save field data to database.

@return bool
Save field data to database .