public function getDatas($request)
    {
        $relation = $this->options['relation'];
        $columnParams = explode('.',$this->options['column']);
        if ( ! $relation ) {
            return [
                'relation_type'     => 'not',
                'datas' => [
                    $columnParams[0]    => $this->fileName,
                    'size'              => $this->fileSize
                ]
            ];
        }
        $datas = [];
        foreach ($this->files as $file) {
            $data = [
                $columnParams[1]    => $file['fileName'],
                'size'              => $file['fileSize']
            ];
            if ((isset($this->options['group']) && isset($this->options['add_column'])) || isset($this->options['add_column'])) {
                foreach($this->options['add_column'] as $column) {
                    $columnData = isset($this->options['group'])
                        ? "{$this->options['group']}.{$this->options['index']}.{$column}"
                        : (isset($this->options['inputPrefix']) ? $this->options['inputPrefix'] . $column : $column);
                    $columnData = $request->input($columnData);
                    if ($columnData) {
                        $data[$column] = $columnData;
                    }
                }
            }
            $datas[] = $data;
        }

        return  [
            'relation_type'     => $relation,
            'relation'          => $columnParams[0],
            'relation_model'    => $this->options['relation_model'],
            'is_reset'          => isset($this->options['is_reset']) && $this->options['is_reset'] ? true : false,
            'changeToHasOne'    => isset($this->options['changeToHasOne']) ? $this->options['changeToHasOne'] : false,
            'datas'             => $relation === 'hasOne' ? $datas[0] : $datas
        ];
    }
public function getDatas($request)
    {
        $relation = $this->options['relation'];
        $columnParams = explode('.',$this->options['column']);
        if ( ! $relation ) {
            return [
                'relation_type'     => 'not',
                'datas' => [
                    $columnParams[0]    => $this->fileName,
                    'size'              => $this->fileSize
                ]
            ];
        }
        $datas = [];
        foreach ($this->files as $file) {
            $data = [
                $columnParams[1]    => $file['fileName'],
                'size'              => $file['fileSize']
            ];
            if ((isset($this->options['group']) && isset($this->options['add_column'])) || isset($this->options['add_column'])) {
                foreach($this->options['add_column'] as $column) {
                    $columnData = isset($this->options['group'])
                        ? "{$this->options['group']}.{$this->options['index']}.{$column}"
                        : (isset($this->options['inputPrefix']) ? $this->options['inputPrefix'] . $column : $column);
                    $columnData = $request->input($columnData);
                    if ($columnData) {
                        $data[$column] = $columnData;
                    }
                }
            }
            $datas[] = $data;
        }

        return  [
            'relation_type'     => $relation,
            'relation'          => $columnParams[0],
            'relation_model'    => $this->options['relation_model'],
            'is_reset'          => isset($this->options['is_reset']) && $this->options['is_reset'] ? true : false,
            'changeToHasOne'    => isset($this->options['changeToHasOne']) ? $this->options['changeToHasOne'] : false,
            'datas'             => $relation === 'hasOne' ? $datas[0] : $datas
        ];
    }
public function getDatas ( $ request ) { $ relation = $ this -> options [ 'relation' ] ; $ columnParams = explode ( '.' , $ this -> options [ 'column' ] ) ; if ( ! $ relation ) { return [ 'relation_type' => 'not' , 'datas' => [ $ columnParams [ 0 ] => $ this -> fileName , 'size' => $ this -> fileSize ] ] ; } $ datas = [ ] ; foreach ( $ this -> files as $ file ) { $ data = [ $ columnParams [ 1 ] => $ file [ 'fileName' ] , 'size' => $ file [ 'fileSize' ] ] ; if ( ( isset ( $ this -> options [ 'group' ] ) && isset ( $ this -> options [ 'add_column' ] ) ) || isset ( $ this -> options [ 'add_column' ] ) ) { foreach ( $ this -> options [ 'add_column' ] as $ column ) { $ columnData = isset ( $ this -> options [ 'group' ] ) ? "{$this->options['group']}.{$this->options['index']}.{$column}" : ( isset ( $ this -> options [ 'inputPrefix' ] ) ? $ this -> options [ 'inputPrefix' ] . $ column : $ column ) ; $ columnData = $ request -> input ( $ columnData ) ; if ( $ columnData ) { $ data [ $ column ] = $ columnData ; } } } $ datas [ ] = $ data ; } return [ 'relation_type' => $ relation , 'relation' => $ columnParams [ 0 ] , 'relation_model' => $ this -> options [ 'relation_model' ] , 'is_reset' => isset ( $ this -> options [ 'is_reset' ] ) && $ this -> options [ 'is_reset' ] ? true : false , 'changeToHasOne' => isset ( $ this -> options [ 'changeToHasOne' ] ) ? $ this -> options [ 'changeToHasOne' ] : false , 'datas' => $ relation === 'hasOne' ? $ datas [ 0 ] : $ datas ] ; }
get datas for save the database

@param $request
@return array
get datas for save the database