Pvalidate: Installation

Installation

To get started with Pvalidate, ensure you have installed the package via Composer:

composer require webhkp/pvalidate

Once installed, you can begin defining validation rules within your classes and leveraging Pvalidate’s powerful validation capabilities.

Available Validation Rules

The following validation rules are included in the default installation-

Required: makes a property required.
Range: check if the value is inside a provided range. We can specify the a minimum and maximum range for the value here.
Allow: check if the property value is one from the allowed list of values.
Disallow: check if the property value does not belong to a list of values.
Regex: check if the value matches the provided regular expression.

NOTE

We can define our custom rule for validation

Check the link below for a custom validation rule creation-

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.