protected function validateParams(array &$params, $rules = null, $clean = false)
	{

		if( ! is_null($rules) )
		{
			// init laravel validator
			$validator = $this->newValidator($params, $rules, $clean);
			$this->setValidator($validator);
		}
		$validator = $this->getValidator();

		$rules = $validator->getRules();
		

		if ($validator->fails())
		{
			// params did not pass validation rules
			
			// add errors to exception
			$this->getException()->addErrors($validator->errors()->toArray());

			return false;
		}
		else
		{
			// params passed validation rules
			return true;
		}
	}
protected function validateParams(array &$params, $rules = null, $clean = false)
	{

		if( ! is_null($rules) )
		{
			// init laravel validator
			$validator = $this->newValidator($params, $rules, $clean);
			$this->setValidator($validator);
		}
		$validator = $this->getValidator();

		$rules = $validator->getRules();
		

		if ($validator->fails())
		{
			// params did not pass validation rules
			
			// add errors to exception
			$this->getException()->addErrors($validator->errors()->toArray());

			return false;
		}
		else
		{
			// params passed validation rules
			return true;
		}
	}
protected function validateParams ( array & $ params , $ rules = null , $ clean = false ) { if ( ! is_null ( $ rules ) ) { // init laravel validator $ validator = $ this -> newValidator ( $ params , $ rules , $ clean ) ; $ this -> setValidator ( $ validator ) ; } $ validator = $ this -> getValidator ( ) ; $ rules = $ validator -> getRules ( ) ; if ( $ validator -> fails ( ) ) { // params did not pass validation rules // add errors to exception $ this -> getException ( ) -> addErrors ( $ validator -> errors ( ) -> toArray ( ) ) ; return false ; } else { // params passed validation rules return true ; } }
Validate params by given rules

@param $params 		array 	- input parameters
@param $rules 		array 	- rules for validator
@param $clean 		boolean - whether to unset params that are not in rules

@return boolean
Validate params by given rules