protected function valid(array $data, array $rules, array $messages = [], array $aliases = [])
    {
        // load translate.
        $this->loadTranslate();

        $this->validation = $this->getValidator()->make($data, $rules, $messages);
        if (\count($aliases) > 0) {
            $this->setAliases($aliases);
        }
        $this->validation->setAliases($this->getAliases());
        $this->validation->validate();

        // if has custom invalid callback.
        if (\method_exists($this, 'InValidCallback') && $this->getValidation()->fails()) {
            return $this->InValidCallback($this->getValidation()->errors()->firstOfAll());
        }

        return !$this->getValidation()->fails();
    }
protected function valid(array $data, array $rules, array $messages = [], array $aliases = [])
    {
        // load translate.
        $this->loadTranslate();

        $this->validation = $this->getValidator()->make($data, $rules, $messages);
        if (\count($aliases) > 0) {
            $this->setAliases($aliases);
        }
        $this->validation->setAliases($this->getAliases());
        $this->validation->validate();

        // if has custom invalid callback.
        if (\method_exists($this, 'InValidCallback') && $this->getValidation()->fails()) {
            return $this->InValidCallback($this->getValidation()->errors()->firstOfAll());
        }

        return !$this->getValidation()->fails();
    }
protected function valid ( array $ data , array $ rules , array $ messages = [ ] , array $ aliases = [ ] ) { // load translate. $ this -> loadTranslate ( ) ; $ this -> validation = $ this -> getValidator ( ) -> make ( $ data , $ rules , $ messages ) ; if ( \ count ( $ aliases ) > 0 ) { $ this -> setAliases ( $ aliases ) ; } $ this -> validation -> setAliases ( $ this -> getAliases ( ) ) ; $ this -> validation -> validate ( ) ; // if has custom invalid callback. if ( \ method_exists ( $ this , 'InValidCallback' ) && $ this -> getValidation ( ) -> fails ( ) ) { return $ this -> InValidCallback ( $ this -> getValidation ( ) -> errors ( ) -> firstOfAll ( ) ) ; } return ! $ this -> getValidation ( ) -> fails ( ) ; }
valid data.

@param array $data
@param array $rules
@param array $messages
@param array $aliases

@return mixed|\Rakit\Validation\Validation
valid data .