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;
	}
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;
	}
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 ; }
Removing request values, based on input when they are not saveable
Removing request values based on input when they are not saveable