private function saveToDatabase(Collection $collection)
    {
        $model = new ImageuploadModel();
        $fillable = $model->getFillable();
        $input = $collection->only($fillable)->toArray();

        $dimensions = $collection['dimensions'];

        foreach ($dimensions as $key => $dimension) {
            foreach ($dimension as $k => $v) {
                $input[$key.'_'.$k] = $v;
            }
        }

        return $model->firstOrCreate($input);
    }
private function saveToDatabase(Collection $collection)
    {
        $model = new ImageuploadModel();
        $fillable = $model->getFillable();
        $input = $collection->only($fillable)->toArray();

        $dimensions = $collection['dimensions'];

        foreach ($dimensions as $key => $dimension) {
            foreach ($dimension as $k => $v) {
                $input[$key.'_'.$k] = $v;
            }
        }

        return $model->firstOrCreate($input);
    }
private function saveToDatabase ( Collection $ collection ) { $ model = new ImageuploadModel ( ) ; $ fillable = $ model -> getFillable ( ) ; $ input = $ collection -> only ( $ fillable ) -> toArray ( ) ; $ dimensions = $ collection [ 'dimensions' ] ; foreach ( $ dimensions as $ key => $ dimension ) { foreach ( $ dimension as $ k => $ v ) { $ input [ $ key . '_' . $ k ] = $ v ; } } return $ model -> firstOrCreate ( $ input ) ; }
Save output to database and return Model collection.

@access private
@param  Collection       $collection
@return ImageuploadModel
Save output to database and return Model collection .