Pvalidate: Required [Validation Rule]

The following code demonstrates the usage of the Webhkp\Pvalidate validation library to validate class properties and individual values based on specified validation rules. Here is the summary of Required rule usage- Import Necessary Classes from Package Object Property Validation Here, the #[Required] attribute specifies that the properties must have values (i.e., they cannot be null … Read more

Pvalidate: Range (including Gt, Gte, Lt, Lte) [Validation Rule]

This documentation provides a detailed explanation of how to use the Webhkp\Pvalidate validation library to validate class properties and individual values based on various validation rules, including range, allow, disallow, greater than, and less than constraints. Import required classes- Object Validation Define a class (MyClass) with properties that require validation: Here, various validation rules are … Read more

Pvalidate: Custom Validation Rule

We can create custom rule for validation for the PValidate package. Let’s see how to create and use a custom validation rule in the Pvalidate library for PHP. This guide will provide a step-by-step example of implementing a custom password validation rule and integrating it into a PHP class. We will create a custom password … Read more

Pvalidate: Installation

WARNING The Pvalidate installation process requires composer. Make sure that you have composer installed on the machine. Installation To get started with Pvalidate, ensure you have installed the package via Composer: NOTE Check the Package details and Source code from the link below- Once installed, you can begin defining validation rules within your classes and … Read more

Pvalidate: Basic Validation

To validate an object of a class, we first need to add the validation rules to the class properties, as attributes. Let’s see how perform a basic validation- Import Validation Rules Rules are in the namespace Webhkp\Pvalidate\Rules. So, import the validation rules you need- Add Validation Rule to Property We can add the rules as … Read more

Pvalidate: Individual Rule Validation

We can use the rules individually to parse some data. Parsing Methods To parse we have two functions- Examples Here are a few examples of using the rules individually to parse and validate data- Required Validation To validate if a field is required, use the Required rule. This example demonstrates how to validate a null … Read more