Download the PHP package bllim/laravalid without Composer

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

Laravalid Build Status

Laravel Validation For Client Side

This package makes validation rules defined in laravel work client-side by converting to html/js plugins such as jquery validation. It also allows to use laravel validation messages so you can show same messages for both sides.

Table of contents

Feature Overview

Installation

Require bllim/laravalid in composer.json and run composer update.

Note: For Laravel 4 use laravel4 branch like as "bllim/laravalid": "dev-laravel4" or "~0.9"

Composer will download the package. After the package is downloaded, open config/app.php and add the service provider and alias as below:

Also you need to publish configuration file and assets by running the following Artisan commands.

Configuration

After publishing configuration file, you can find it in config folder as laravalid.php file. Configuration parameters are as below:

Parameter Description Values
plugin Choose plugin you want to use See Plugins and Supported Rules
useLaravelMessages If it is true, laravel validation messages are used in client side otherwise messages of chosen plugin are used true/false
route Route name for remote validation Any route name (default: laravalid)

Usage

The package uses laravel Form Builder to make validation rules work for both sides. Therefore you should use Form Builder. While opening form by using Form::open you can give $rules as second parameter:

Also if you don't want to struggle with $rules at view files, you can set it in Controller or route with or without form name by using Form::setValidation($rules, $formName). If you don't give form name, this sets rules for first Form::open

For rules which is related to input type in laravel (such as max, min), the package looks for other given rules to understand which type is input. If you give integer or numeric as rule with max, min rules, the package assume input is numeric and convert to data-rule-max instead of data-rule-maxlength.

The converter assume input is string by default. File type is also supported.

Validation Messages

Converter uses validation messages of laravel (resources/lang/en/validation.php) by default for client-side too. If you want to use jquery validation messages, you can set useLaravelMessages, false in config file of package which you copied to your config dir.

Plugins

Jquery Validation While using Jquery Validation as html/js validation plugin, you should include jquery.validate.laravalid.js in your views, too. After assets published, it will be copied to your public folder. The last thing you should do at client side is initializing jquery validation plugin as below:

Example

Controller/Route side

View side

Extending

There are two ways to extend package with your own rules. First, you can extend current converter plugin dynamically like below:

Second, you can create your own converter (which extends Base\Converter or any current plugin converter) in Bllim\Laravalid\Converter\ namespace and change plugin configuration in config file with your own plugin name.

Note: If you are creating a converter for some existed html/js plugin please create it in Converter folder and send a pull-request.

Plugins and Supported Rules

Jquery Validation To use Jquery Validation, change plugin to JqueryValidation in config file and import jquery, jquery-validation and jquery.validate.laravalid.js in views.

Rules Jquery Validation
Accepted -
Active URL +
After (Date) +
Alpha +
Alpha Dash -
Alpha Numeric +
Array -
Before (Date) +
Between +
Boolean -
Confirmed -
Date +
Date Format -
Different +
Digits -
Digits Between -
E-Mail +
Exists (Database) +
Image (File) +
In -
Integer +
IP Address +
Max +
MIME Types +
Min +
Not In -
Numeric +
Regular Expression +
Required +
Required If -
Required With +
Required With All -
Required Without +
Required Without All -
Same +
Size -
String -
Timezone -
Unique (Database) +
URL +

Note: It is easy to add some rules. Please check Rule class of related converter.

Contribution

You can fork and contribute to development of the package. All pull requests is welcome.

Conversion Logic Package converts rules by using converters (in src/Bllim/Laravalid/Converter). It uses Converter class of chosen plugin which extends Converter/Base/Converter class. You can look at existed methods and plugins to understand how it works. Explanation will be ready, soon.

Known issues

TODO

Contributors

and more

License

Licensed under the MIT License


All versions of laravalid with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
laravelcollective/html Version ~5.0
illuminate/support Version ~5.0
illuminate/validation Version ~5.0
illuminate/routing Version ~5.0
illuminate/translation Version ~5.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 bllim/laravalid contains the following files

Loading the files please wait ....