Http/Controllers/Admin/GroupFieldsController.php
public function store(GroupFieldRequest $request)
    {
        $data = $request->all();
        $dataGroup = $data['group'];
        $dataFields = $data['field'];
        // reset key of array location
        $dataLocations     = array_values($data["location"]);
        $newDataLocations = array_map('array_values', $dataLocations);

        $bResult = $this->group->saveData($dataGroup, $dataFields, $newDataLocations);
        $groupId = @$data["group"]["id"];
        $tran_core = 'core::core.messages.resource created';
        if ($groupId > 0) {
            $tran_core = 'core::core.messages.resource updated';
        }
        if ($bResult) {
            flash()->success(trans($tran_core, ['name' => trans('dynamicfield::dynamicfield.title.field_group')]));
        }

        return redirect()->route('admin.dynamicfield.group.index');
    }
public function store(GroupFieldRequest $request)
    {
        $data = $request->all();
        $dataGroup = $data['group'];
        $dataFields = $data['field'];
        // reset key of array location
        $dataLocations     = array_values($data["location"]);
        $newDataLocations = array_map('array_values', $dataLocations);

        $bResult = $this->group->saveData($dataGroup, $dataFields, $newDataLocations);
        $groupId = @$data["group"]["id"];
        $tran_core = 'core::core.messages.resource created';
        if ($groupId > 0) {
            $tran_core = 'core::core.messages.resource updated';
        }
        if ($bResult) {
            flash()->success(trans($tran_core, ['name' => trans('dynamicfield::dynamicfield.title.field_group')]));
        }

        return redirect()->route('admin.dynamicfield.group.index');
    }
@param GroupFieldRequest $request

@return \Illuminate\Http\RedirectResponse