src/Components/Validation/Validation.php
public function isValid(array $data = [])
    {
        if (empty($data)) {
            $data = http()->method() == 'GET' ? http()->get() : http()->post();
        }
        $this->data = $data;

        foreach ($this->rules as $key => $value) {
            $rules = explode('|', $value);
            foreach ($rules as $rule) {
                if (strpos($rule, ',')) {
                    $group = explode(',', $rule);
                    $filter = $group[0];
                    $params = $group[1];
                    $this->errorMessage($filter, $key, $params);
                } else {
                    $this->errorMessage($rule, $key);
                }
            }
        }

        $this->errors = array_values(array_unique($this->errors));
        if (count($this->errors) > 0) {
            return false;
        }

        return true;
    }
public function isValid(array $data = [])
    {
        if (empty($data)) {
            $data = http()->method() == 'GET' ? http()->get() : http()->post();
        }
        $this->data = $data;

        foreach ($this->rules as $key => $value) {
            $rules = explode('|', $value);
            foreach ($rules as $rule) {
                if (strpos($rule, ',')) {
                    $group = explode(',', $rule);
                    $filter = $group[0];
                    $params = $group[1];
                    $this->errorMessage($filter, $key, $params);
                } else {
                    $this->errorMessage($rule, $key);
                }
            }
        }

        $this->errors = array_values(array_unique($this->errors));
        if (count($this->errors) > 0) {
            return false;
        }

        return true;
    }
public function isValid ( array $ data = [ ] ) { if ( empty ( $ data ) ) { $ data = http ( ) -> method ( ) == 'GET' ? http ( ) -> get ( ) : http ( ) -> post ( ) ; } $ this -> data = $ data ; foreach ( $ this -> rules as $ key => $ value ) { $ rules = explode ( '|' , $ value ) ; foreach ( $ rules as $ rule ) { if ( strpos ( $ rule , ',' ) ) { $ group = explode ( ',' , $ rule ) ; $ filter = $ group [ 0 ] ; $ params = $ group [ 1 ] ; $ this -> errorMessage ( $ filter , $ key , $ params ) ; } else { $ this -> errorMessage ( $ rule , $ key ) ; } } } $ this -> errors = array_values ( array_unique ( $ this -> errors ) ) ; if ( count ( $ this -> errors ) > 0 ) { return false ; } return true ; }
Validate

@param array $data

@return boolean
Validate