Download the PHP package macocci7/purephp-validation without Composer

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

Purephp Validation

1. Features

Purephp Validation is a standalone library to use the Illuminate\Validation package outside the Laravel framework.

This library is based on jeffochoa/validator-factory,

This library is customized to use with static calls, like a Laravel Facade:

It also supports Password rule object and File rule object.

Additionally and uniquely, Instance rule object is supported.

2. Contents

3. Requirements

4. Installation

5. Usage

5.1. Basic Usage

First, import autoload.php into your code (in src/ folder) like this:

Then, create a new instance of the Illuminate\Validation\Validator as follows:

Now, you can check the validation results:

You can learn more about writing validation rules at the Laravel Official Documentation.

Here's also an example code for basic usage: BasicUsage.php

5.2. Setting Translations Root Path and Language

You'll probably want to place the lang folder somewhere else outside of vendor/.

You can set the Translations Root Path before creating an instance of Validator:

You can also set the Language before creating an instance of Validator:

Here's an example code for setting Translations Root Path and Language: SetTranslationsRootPath.php

5.3. Using Password Rule Object

You can validate passwords using Laravel's Password rule object.

You can learn more about Laravel's Password rule object at the Laravel Official Document.

Here's an example code for using Password rule object: ValidatePassword.php

5.4. Using File Rule Object

You can validate files using Laravel's File rule object.

You can learn more about Laravel's File rule object at the Laravel Official Document.

Here's an example code for using Laravel's File rule object: ValidateFile.php

5.5. Using Instance Rule Object

You can validate objects using Instance rule object. (unique feature)

By using Instance::of($class) method as a rule, you can perform $value instanceof $class in the validation.

Instance::of() accepts class name(s) as an argument.

Here's an example code for using Instance rule object: ValidateInstance.php

6. Examples

7. LICENSE

MIT


Copyright 2024 macocci7


All versions of purephp-validation with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/validation Version ^11.5
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 macocci7/purephp-validation contains the following files

Loading the files please wait ....