Laravel Cloud is here! Zero-config managed infrastructure for Laravel apps. Deploy now.

Laravel Jsvalidation

proengsoft/laravel-jsvalidation image

Laravel Jsvalidation stats

Downloads
1.5M
Stars
1,077
Open Issues
16
Forks
196

View on GitHub →

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

Laravel Javascript Validation

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.

Supported versions

Laravel 9.x - 10.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="https://raw.githubusercontent.com/proengsoft/laravel-jsvalidation/master//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/proengsoft/laravel-jsvalidation/master//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.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Proengsoft Laravel Jsvalidation Related Articles

Testing API Validation Errors With Different Locales image

Testing API Validation Errors With Different Locales

Read article
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit