Skip to content

The Validate Method #11

Description

@clevonnoel

It would be nice to handle validation like $this->registrationForm->validate();where necessary.

Here are the untested suggested code.

    public function validate(array $formData = null)
    {
        $this->validation = $this->validator->make(
            $formData ?: Input::all(),
            $this->getValidationRules(),
            $this->getValidationMessages()
        );

        if ($this->validation->fails())
        {
            throw new FormValidationException('Validation failed', $this->getValidationErrors());
        }

        return true;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions