original_string: protected function removeUnregistratedFields($request, $postTypeModel)
  	{
  		$whitelisted = [];
  		$whitelisted[] = 'template';
  
  		foreach($request->all() as $requestKey => $requestValue){
  			$customField = $this->getCustomFieldObject($postTypeModel, $requestKey);
  			if($customField){
  				if(array_key_exists('saveable', $customField) && $customField['saveable'] == false){
  
  				} else {
  					$whitelisted[] = $requestKey;
  				}
  			}
  		}
  
  		$newRequest = $request->only($whitelisted);
  
  		$request = $this->resetRequestValues($request);
  		foreach($newRequest as $key => $value){
  			$request[$key] = $value;
  		}
  
  		return $request;
  	}
code: protected function removeUnregistratedFields($request, $postTypeModel)
  	{
  		$whitelisted = [];
  		$whitelisted[] = 'template';
  
  		foreach($request->all() as $requestKey => $requestValue){
  			$customField = $this->getCustomFieldObject($postTypeModel, $requestKey);
  			if($customField){
  				if(array_key_exists('saveable', $customField) && $customField['saveable'] == false){
  
  				} else {
  					$whitelisted[] = $requestKey;
  				}
  			}
  		}
  
  		$newRequest = $request->only($whitelisted);
  
  		$request = $this->resetRequestValues($request);
  		foreach($newRequest as $key => $value){
  			$request[$key] = $value;
  		}
  
  		return $request;
  	}
code_tokens: protected function removeUnregistratedFields ( $ request , $ postTypeModel ) { $ whitelisted = [ ] ; $ whitelisted [ ] = 'template' ; foreach ( $ request -> all ( ) as $ requestKey => $ requestValue ) { $ customField = $ this -> getCustomFieldObject ( $ postTypeModel , $ requestKey ) ; if ( $ customField ) { if ( array_key_exists ( 'saveable' , $ customField ) && $ customField [ 'saveable' ] == false ) { } else { $ whitelisted [ ] = $ requestKey ; } } } $ newRequest = $ request -> only ( $ whitelisted ) ; $ request = $ this -> resetRequestValues ( $ request ) ; foreach ( $ newRequest as $ key => $ value ) { $ request [ $ key ] = $ value ; } return $ request ; }
docstring: Removing request values, based on input when they are not saveable
docstring_tokens: Removing request values based on input when they are not saveable