Giter Site home page Giter Site logo

laravel-jsvalidation's Introduction

Laravel Javascript Validation

Latest Version tests Code Coverage Total Downloads License

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 6.x - 8.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.

laravel-jsvalidation's People

Contributors

dependabot[bot] avatar torrentalle avatar bytestream avatar dependabot-preview[bot] avatar antonkomarev avatar gaffel avatar scrutinizer-auto-fixer avatar cwdn avatar drjoju avatar xuandung38 avatar sangnguyenplus avatar marcuzz avatar samuelfa avatar braunson avatar adamtester avatar lvqingan avatar yepzy avatar neflictus avatar mankowitz avatar changhuapeng avatar bidord avatar sineld avatar salbertson avatar mmeshkatian avatar leonardoldr23 avatar kevinnewesil avatar dansleboby avatar pdsuk avatar danielgsoftware avatar henryonsoftware avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.