Download the PHP package laravel-validators/foundation without Composer

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

Foundation

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

An opinionated way to register custom validators in Laravel.

Installation

Begin by installing the package through Composer.

Create a service provider that extends LaravelValidators\Foundation\ValidationServiceProvider.

Then add the following to the providers array in config/app.php.

Usage

This package does not add any special functionality, it is essentially a wrapper for the following.

Creating validators

Like Laravel you can define custom validators as either closures or classes. Validators are typically stored in the app/Validators directory; however, you are free to choose your own storage location as long as your commands can be loaded by Composer.

Generating validators

To create a new validator, use the make:validator Artisan command - provided by this package. This command will create a new validator class in the app/Validators directory. Don't worry if this directory does not exist in your application, since it will be created the first time you run the make:validator Artisan command.

The validate method will be called when your validator is executed. You may place your validation logic in this method.

Let's take a look at an example validator. Note that we are able to inject any dependencies we need into the validator's constructor. The Laravel service container will automatically inject all dependencies type-hinted in the constructor:

Finally register the custom validator class in the $rules array in App\Providers\ValidationServiceProvider.

Closure validators

Closure based validators provide an alternative to defining validators as classes. These are defined in the App\Providers\ValidationServiceProvider class using the inherited ->rule() method.

Error messages

If your custom validator class provides a public static message() method, it will be used to retrieve the validation message.

Sanitize input

If you want to sanitise data before it is validated, you can specify a sanitize method on your validator.

Credits


All versions of foundation with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/support Version 5.3.* || 5.4.*
illuminate/validation Version 5.3.* || 5.4.*
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 laravel-validators/foundation contains the following files

Loading the files please wait ....