Download the PHP package ez-php/validation without Composer

On this page you can find all versions of the php package ez-php/validation. 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 validation

ez-php/validation

Validation module for the ez-php framework — rule-based validator with database-backed unique/exists rules and optional i18n support.

CI

Requirements

Installation

Optionally install ez-php/i18n for localised error messages:

Usage

Supported rules

Rule Description
required Field must be present and non-empty
string Must be a string
integer Must be an integer
email Must be a valid email address
min:n Minimum value (numeric) or minimum length (string)
max:n Maximum value (numeric) or maximum length (string)
regex:/pattern/ Must match the given regex
unique:table,column Value must not exist in the given DB column
exists:table,column Value must exist in the given DB column
confirmed Value must match {field}_confirmation in the input
same:other Value must equal the value of other field
different:other Value must differ from the value of other field
date Must be a valid date parseable by strtotime()
date_format:Y-m-d Must exactly match the given PHP date format
before:date Must be a date strictly before the reference
after:date Must be a date strictly after the reference
file Must be a valid $_FILES upload (UPLOAD_ERR_OK)
image Upload MIME type must be image/*
mimes:jpg,png Upload file extension must be in the list
max_size:n Upload size must not exceed n kilobytes
dimensions:min_width=N,... Image dimensions must satisfy the constraints
sometimes Skip all rules for this field when its key is absent from the data

Rules skip silently for absent/empty values (except required and sometimes). Combine required with type rules to enforce both presence and type.

FormRequest

For controller-level validation with optional authorization, extend FormRequest:

Inject it into a controller action — it validates automatically on instantiation:

FormRequest throws ValidationException on rule failures and AuthorizationException when authorize() returns false.

With i18n

Pass a Translator instance to receive messages in the configured locale:

License

MIT — Andreas Uretschnig


All versions of validation with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ez-php/contracts Version ^1.0
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 ez-php/validation contains the following files

Loading the files please wait ...