Download the PHP package blakvghost/php-validator without Composer

On this page you can find all versions of the php package blakvghost/php-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-validator

logo PHPValidator

![Packagist Version (custom server)](https://img.shields.io/packagist/v/BlakvGhost/php-validator?label=stable) ![Packagist Version (custom server)](https://img.shields.io/packagist/l/BlakvGhost/php-validator?label=Licence) ![Packagist Version (custom server)](https://img.shields.io/packagist/dt/BlakvGhost/php-validator?label=download)

About PHPValidator

PHPValidator is a modern PHP library for data validation in your PHP applications. It provides a flexible and extensible way to validate data using predefined rules or by creating custom validation rules.

Installation

Use Composer to install PHPValidator:

Usage

You can also customize the validation error messages or specify the default language

Features

List of Predefined Rules

PHPValidator provides a variety of predefined rules that you can use for data validation. Here is a list of some commonly used rules along with examples of their usage:

  1. Required Rule

    • Ensures that a field is present in the data.
  2. String Rule

    • Checks if a field is of string type.
  3. Email Rule

    • Validates that a field is a well-formed email address.
  4. Max Length Rule

    • Specifies the maximum length of a string field.
  5. Confirmed Rule

    • Checks if a field's value is the same as another field (commonly used for password confirmation).
  6. File Rule

    • Validates that a field is a file upload.
  7. Accepted Rule

    • Validates that a field is "yes", "on", "1", or true. Useful for checkboxes.
  8. Accepted If Rule

    • Validates that a field is accepted if another field is equal to a specified value.
  9. ActiveURL Rule

    • Validates that a field is a valid, active URL.
  10. Alpha Rule

    • Validates that a field contains only alphabetic characters.
  11. Numeric Rule

    • Validates that a field contains only numeric characters.
  12. Lowercase Rule

    • Validates that a field contains only lowercase alphabetic characters.
  13. Uppercase Rule

    • Validates that a field contains only uppercase alphabetic characters.
  14. In Rule

    • Validates that a field's value is among a list of predefined values.
  15. Nullable Rule

    • Allows a field to be null or empty.
  16. Password Rule

    • Validates that a field is a secure password.
  17. Same Rule

    • Validates that a field's value is the same as the value of another field.
  18. Max Length Rule

    • Specifies the minimum length of a string field.
  19. Not In Rule

    • Validates that a field's value is not in a specified set.
  20. Required With Rule

    • Requires the field to be present if another specified field is present.
  21. Valid IP Rule

    • Validates that a field's value is a valid IP address.
  22. Json Rule

    • Validates that a field's value is a valid JSON string.
  23. URL Rule

    • Validates that a field's value is a valid URL.
  24. Alpha Numeric Rule

    • Validates that a field's value contains only alphanumeric characters.
  25. Boolean Rule

    • Validates that a field's value is a boolean.
  26. Size Rule
    • Validates that the size of a string, integer, array, or file is equal to a specified value.

Custom Rule

In addition to the predefined rules, you can create custom validation rules by implementing the Rule Interface. Here's an example of how to create and use a custom rule:

CustomPasswordRule.php

Usage in Validator

In this example, we created a CustomPasswordRule that checks if the password is equal to confirm_password. You can customize the passes method to implement your specific validation logic.

Contributing

If you would like to contribute to PHPValidator, please follow our Contribution Guidelines.

Authors

Support

For support, you can reach out to me by email at [email protected]. Feel free to contact me if you have any questions or need assistance with PHPValidator.

License

PHPValidator is open-source software licensed under the MIT license.


All versions of php-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blakvghost/php-validator contains the following files

Loading the files please wait ....