laravel-jsvalidation 0,0 scrutinizer styleci travis-ci Bower Packagist gulp npm phpunit

Laravel 5 Javascript Validation

Laravel 5 Javascript Validation

Latest Version Build Status Code Coverage Quality Score Total Downloads

Laravel Javascript Validation package allows to reuse your Laravel Validation Rules, Messages, FormRequest and Validators to validate forms automatically in client side without need to write any Javascript code or use HTML Builder Class.

You can validate forms automatically referencing it to your defined validations. The messages are loaded from your validations and translated according your Localization preferences.

Feature overview

Supported Rules

Almost all Validation Rules provided by Laravel and other packages are supported.

Almost are validated in client-side using Javascript, but in some cases, the validation should to be done in server-side via AJAX: - ActiveURL - Unique - Exists - Custom Validation Rules - Validations provided by other packages

Unsupported Rules and Features

Some Laravel features and validations are not implemented yet. Pull Requests are welcome!

  • Validating Arrays using wildcards [‘person.*.email’ => ‘email|unique:users’] is not supported. #139 (supported in master branch)
  • Distinct rule
  • Present rule
  • InArray rule
  • DateFormat rule don’t support timezone format

Getting started

The easiest way to create Javascript validations is using Laravel Form Request Validation.

Installation

Follow the Installation Guide to install the package. The default config shlould work out-of-box

Validating Form Request

Call JsValidator Facade in your view to validate any FormRequest

 <form>
    <!-- ... My form stuff ... -->
 <form>

 <!-- Javascript Requirements -->
 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
 <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>

 <!-- Laravel Javascript Validation -->
 <script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js')}}"></script>

{!! JsValidator::formRequest('App\Http\Requests\MyFormRequest') !!}

Take a look to Basic Usage or Examples to get more information.

Documentation

To get more info refer to Project Wiki

License

The MIT License (MIT). Please see License File for more information.

Related Repositories

laravel-jsvalidation

laravel-jsvalidation

Laravel 5 Javascript Validation ...


Top Contributors

torrentalle gaffel scrutinizer-auto-fixer adamtester derekmd drjoju samuelfa adriandmitroca dennisoderwald sineld changhuapeng lvqingan

Dependencies

package version
bower ^1.8.0
laravel-elixir ^4.0.0
dev gulp ^3.8.8

Releases

-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.0 zip tar
-   v1.2.0rc1 zip tar
-   v1.1.4 zip tar
-   v1.1.3 zip tar
-   v1.1.2 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar
-   v1.0.6 zip tar
-   v1.0.5 zip tar
-   v1.0.4 zip tar
-   v1.0.3 zip tar
-   v1.0.2 zip tar
-   v1.0.1 zip tar
-   v1.0.0 zip tar
-   v1.0.0-rc1 zip tar