original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Save output to database and return Model collection.
  
  @access private
  @param  Collection       $collection
  @return ImageuploadModel
docstring_tokens: Save output to database and return Model collection .