protected function ensureAllInRules(array $data)
    {
        $rules = $this->rules();

        $invalid = array_diff_key($data, $rules);

        if (!empty($invalid)) {
            throw new ValidationFailed(new MessageBag([
                'Invalid keys found in request.',
            ]));
        }

        return $this;
    }
protected function ensureAllInRules(array $data)
    {
        $rules = $this->rules();

        $invalid = array_diff_key($data, $rules);

        if (!empty($invalid)) {
            throw new ValidationFailed(new MessageBag([
                'Invalid keys found in request.',
            ]));
        }

        return $this;
    }
protected function ensureAllInRules ( array $ data ) { $ rules = $ this -> rules ( ) ; $ invalid = array_diff_key ( $ data , $ rules ) ; if ( ! empty ( $ invalid ) ) { throw new ValidationFailed ( new MessageBag ( [ 'Invalid keys found in request.' , ] ) ) ; } return $ this ; }
Make sure all of the keys of the given array exist in our ruleset.

@param array $data
@return $this
@throws \FluxBB\Server\Exception\ValidationFailed
Make sure all of the keys of the given array exist in our ruleset .