original_string: public function import($modelName, $defaultValues = [], $updateMultipleModel = false, $queryConfigs = [])
  	{
  		$isSuccessful = true;
  
  		$sheetData = $this->arrayFromExcel;
  		$this->header = array_shift($sheetData);
  
  		foreach ($sheetData as $record) {
  
  			if ($updateMultipleModel) {
  
  				$parentId = $this->getParentId($queryConfigs['parentModel'], $queryConfigs['parentKey'],
  				$record, $modelName, $defaultValues);
  
  				$childModel = new $queryConfigs['childModel'];
  				foreach ($queryConfigs['childModelArray'] as $key=>$value) {
  					if (!is_array($value)) {
  						$childModel->$value = $this->getCellValue($value, $childModel, $record, $key, false);
  					} else {
  						$childModel->$value['attribute'] = $this->getCellValue($value, $childModel, $record, $key, false);
  					}
  				}
  
  				$childModel->$queryConfigs['childForeignKey'] = $parentId;
  				$childModel->save();
  			} else {
  
  				$isSuccessful = $this->createModel($modelName, $defaultValues, $record);
  			}
  		}
  		return $isSuccessful;
  	}
code: public function import($modelName, $defaultValues = [], $updateMultipleModel = false, $queryConfigs = [])
  	{
  		$isSuccessful = true;
  
  		$sheetData = $this->arrayFromExcel;
  		$this->header = array_shift($sheetData);
  
  		foreach ($sheetData as $record) {
  
  			if ($updateMultipleModel) {
  
  				$parentId = $this->getParentId($queryConfigs['parentModel'], $queryConfigs['parentKey'],
  				$record, $modelName, $defaultValues);
  
  				$childModel = new $queryConfigs['childModel'];
  				foreach ($queryConfigs['childModelArray'] as $key=>$value) {
  					if (!is_array($value)) {
  						$childModel->$value = $this->getCellValue($value, $childModel, $record, $key, false);
  					} else {
  						$childModel->$value['attribute'] = $this->getCellValue($value, $childModel, $record, $key, false);
  					}
  				}
  
  				$childModel->$queryConfigs['childForeignKey'] = $parentId;
  				$childModel->save();
  			} else {
  
  				$isSuccessful = $this->createModel($modelName, $defaultValues, $record);
  			}
  		}
  		return $isSuccessful;
  	}
code_tokens: public function import ( $ modelName , $ defaultValues = [ ] , $ updateMultipleModel = false , $ queryConfigs = [ ] ) { $ isSuccessful = true ; $ sheetData = $ this -> arrayFromExcel ; $ this -> header = array_shift ( $ sheetData ) ; foreach ( $ sheetData as $ record ) { if ( $ updateMultipleModel ) { $ parentId = $ this -> getParentId ( $ queryConfigs [ 'parentModel' ] , $ queryConfigs [ 'parentKey' ] , $ record , $ modelName , $ defaultValues ) ; $ childModel = new $ queryConfigs [ 'childModel' ] ; foreach ( $ queryConfigs [ 'childModelArray' ] as $ key => $ value ) { if ( ! is_array ( $ value ) ) { $ childModel -> $ value = $ this -> getCellValue ( $ value , $ childModel , $ record , $ key , false ) ; } else { $ childModel -> $ value [ 'attribute' ] = $ this -> getCellValue ( $ value , $ childModel , $ record , $ key , false ) ; } } $ childModel -> $ queryConfigs [ 'childForeignKey' ] = $ parentId ; $ childModel -> save ( ) ; } else { $ isSuccessful = $ this -> createModel ( $ modelName , $ defaultValues , $ record ) ; } } return $ isSuccessful ; }
docstring: Import the excel to the model using active record
  @param string $model The model name to save the excel rows into
  @param array $defaultValues The default values to be assigned
  @return Return true if all records is saved
docstring_tokens: Import the excel to the model using active record