proengsoft/laravel-jsvalidation
Composer 安装命令:
composer require proengsoft/laravel-jsvalidation
包简介
Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest
README 文档
README
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
- PHP 8.2 - 8.4
- Laravel 11.x - 13.x
Feature overview
- Automatic creation of Javascript validation based on your Validation Rules or FormRequest, no Javascript coding required.
- Supports other validation packages.
- AJAX validation for ActiveURL, Unique and Exists Rules, Custom Validation Rules and other validation packages
- Unobtrusive integration, you can use without Laravel Form Builder
- The package uses Jquery Validation Plugin bundled in provided script.
- Uses Laravel Localization to translate messages.
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
Some Laravel validations are not implemented yet.
- Present
- 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 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.
proengsoft/laravel-jsvalidation 适用场景与选型建议
proengsoft/laravel-jsvalidation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.35M 次下载、GitHub Stars 达 1.15k, 最近一次更新时间为 2015 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jquery」 「javascript」 「form」 「validator」 「validation」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 proengsoft/laravel-jsvalidation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 proengsoft/laravel-jsvalidation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 proengsoft/laravel-jsvalidation 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
PHP client for the Google Closure Compiler API in one file.
统计信息
- 总下载量: 2.35M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1159
- 点击次数: 25
- 依赖项目数: 56
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-17