proengsoft / laravel-jsvalidation by torrentalle

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest
1,725,033
1,110
32
Package Data
Maintainer Username: torrentalle
Maintainer Contact: albert@memorylimit.net (Albert Moreno)
Package Create Date: 2015-03-15
Package Last Update: 2024-05-13
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-05-18 03:09:24
Package Statistics
Total Downloads: 1,725,033
Monthly Downloads: 22,713
Daily Downloads: 806
Total Stars: 1,110
Total Watchers: 32
Total Forks: 175
Total Open Issues: 23

Laravel 5 Javascript Validation

Latest Version Build Status Code Coverage Quality Score Total Downloads Reviewed by Hound

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.

Version matrix

| Laravel Version | Package Version | | --------------- | --------------- | | 5.8 | 2.x (>2.4.0) | | 5.7 | 2.x (>2.3.1) | | 5.6 | 2.x (>2.2.0) | | 5.5 | 2.x (>2.1.0) | | 5.4 | 2.x | | 5.3 | 1.x | | 5.2 | 1.x | | 5.1 | 1.x | | 5.0 | 1.x |

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:

Unsupported Rules

Some Laravel validations are not implemented yet.

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 should 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

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Laravel Javascript Validation contributors list

License

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