Download the PHP package wamesk/laravel-validator without Composer

On this page you can find all versions of the php package wamesk/laravel-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 laravel-validator

Laravel Validator

Laravel package that extends default laravel validator

Installation

Publish translations

Validator

Validator used by default in this package. It works by chaining functions and getting response. Response is generated by wamesk/laravel-api-response package functions. To better understand how response works checkout documentation for response package here

Validate function

This function is final function. Always last. It requires data and rules for validation. Documentation for rules click here

Usage example:

In case of validation error it will return

Code function

This function is add internal code in response. You can pass second parameter that changes prefix for message translation.

Usage example:

In case of validation error it will return

Messages function

This function adds custom response for validation. You need to pass objects of which key is field, and it's validation. As value, you pass your custom message as shown in example.

Usage example:

In case of validation error it will return

Status Code function

This function doesn't change response visually but changes status code of response. Default status code is 400 (Bad Request). If you want to chain all functions it can look like this. Status code is always integer.

Rules

This package also provides you with these custom rules for your project.

Usage:

Exists rule

This rule validates if entity exists. It requires model class in construct. Firstly it validates if there is entity with this parameter in database. Secondly it checks if it wasn't deleted, if it was it returns validation error. You can pass second (optional) parameter column name.

IsInteger rule

This rule validates if attribute is integer. You can pass additional data (min, max) in construct to create range of acceptable integers.

IsString rule

This rule validates if attribute is string. You can pass additional data (min, max) to validate length of string.

IsArray rule

This rule validates if attribute is array. You can pass additional data (min, max) to validate length of array.

IsEmail rule

Validates email format, checks domain existence, and optionally blocks temporary email domains in Laravel. You can pass additional data (true, false) to enable some functions.


All versions of laravel-validator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
laravel/framework Version ^9.0|^10.0
wamesk/laravel-api-response 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 wamesk/laravel-validator contains the following files

Loading the files please wait ....