Download the PHP package nelson-dominici/slimgry without Composer

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

Descrição da Imagem
License: MIT Requires PHP ^8.2 Requires Slim Framework >=   4

Slimgry is a validation middleware for the Slim framework, which validates the request body, with validation syntax similar to Laravel.

Install

Usage

To add validations to a route, add the NelsonDominici\Slimgry\Slimgry middleware with the validations in the constructor.
If any validation method fails, an NelsonDominici\Slimgry\Exceptions\ValidationMethodException exception will be thrown.

You can also use |.

Validating nested fields

You can use "dot notation" to validate nested fields, example:

Adding custom message when validation method fails

Add a second array in the Slimgry class to store custom messages, choose which field the message refers to along with a "dot" and the validation method that failed.

Validation Methods List

Validation Method Function Attention!
array The field under validation must be a PHP array
boolean The field under validation must be a boolean Only true or false is accepted
email The field under validation must be a valid email filter_var() is used with FILTER_VALIDATE_EMAIL
gt:value The field under validation must be greater than a numeric value Only numeric values are validated
gte:value The field under validation must be greater than or equal to a numeric value Only numeric values are validated
integer The field under validation must be an integer
ip The field under validation must be an IP address filter_var() is used with FILTER_VALIDATE_IP
max:value The field under validation must have a maximum number of elements Only arrays, strings, and numeric values are validated
min:value The field under validation must have a minimum number of elements Only arrays, strings, and numeric values are validated
nullable The field under validation may be null
numeric The field under validation must be numeric
present The field under validation must exist in request body
regex:pattern The field under validation must match the given regular expression
required The field under validation must be present in request body and not "empty" Values considered "empty" are null, empty string and empty array
size:value The field under validation must have a specific number of elements Only arrays, strings, and numeric values are validated
string The field under validation must be a string
trim Remove white space from The field under validation
uuid The field under validation must be a valid universally unique identifier (UUID) in 4 version

All versions of slimgry with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
slim/slim Version ^4.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 nelson-dominici/slimgry contains the following files

Loading the files please wait ....