Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Jsvalidation

Laravel Jsvalidation Laravel Package

proengsoft/laravel-jsvalidation

Generate client-side form validation automatically from your Laravel rules, messages, validators, and FormRequest classes—no custom JavaScript needed. Built on jQuery Validation, supports localization, and uses AJAX for rules like unique/exists/active_url and custom rules.

View on GitHub
Deep Wiki
Context7

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

Frequently asked questions about Laravel Jsvalidation
How does this package sync Laravel validation rules to client-side without writing custom JavaScript?
The package automatically generates client-side validation rules by parsing your Laravel FormRequest classes or validation logic. It uses the jQuery Validation Plugin under the hood, so you only need to reference your existing validation setup in Blade views via the JsValidator facade. This ensures your client-side and server-side rules stay in sync.
Does this work with Laravel 13 and PHP 8.4? What if I’m using an older version?
Yes, it officially supports Laravel 11–13 and PHP 8.2–8.4. If you’re on an older version, you’ll need to manually update dependencies or use Laravel’s upgrade helper. The package doesn’t support Laravel 10 or below, so check your project’s compatibility before installing.
Can I use this with Vue.js or React instead of jQuery?
No, this package relies on jQuery Validation Plugin (v1.19.x), which isn’t compatible with modern SPAs like Vue or React. If you’re using those frameworks, consider alternatives like VeeValidate or manually integrating Laravel’s validation API via AJAX calls to your backend.
How do I handle server-dependent rules like `unique` or `exists` on the client side?
The package automatically handles these rules via AJAX under the hood. When a user submits a form, it checks these constraints in real-time against your Laravel backend, ensuring data integrity without requiring manual JavaScript. Just include the form in your Blade template with the JsValidator facade.
What if my validation rules include unsupported Laravel rules like `present` or `dateFormat`?
Unsupported rules (e.g., `present`, `dateFormat` with timezones) won’t generate client-side validation. The package falls back to server-side validation for these cases. You can either handle them manually with custom JavaScript or ensure your FormRequest includes server-side validation as a backup.
How do I integrate this with Laravel’s localization for error messages?
The package automatically pulls error messages from Laravel’s localization files (e.g., `resources/lang`). Just ensure your validation messages are properly translated in your language files, and the client-side validation will reflect those translations without extra configuration.
Will this slow down my application if I have a large form with many validation rules?
The package bundles jQuery and the validation plugin, which can impact page load times for heavy forms. To mitigate this, consider lazy-loading the validation script or using Laravel Mix/Vite to split the bundle. Test performance in your staging environment to ensure it meets your UX standards.
Can I use this with third-party validation packages like `spatie/laravel-validation-rules`?
Yes, the package supports third-party validation rules as long as they’re compatible with Laravel’s core validation system. However, test custom rules thoroughly, as some may not translate perfectly to client-side JavaScript. Check the package’s documentation for known limitations.
How do I publish the validation script to my public assets folder?
Run `php artisan vendor:publish --tag=jsvalidation-assets` to publish the bundled `jsvalidation.js` to `public/vendor/jsvalidation/`. Then include it in your Blade layout or use Laravel Mix/Vite to process and optimize it. Ensure the path matches your asset configuration.
What are the alternatives if I don’t want to use jQuery or need more modern frontend support?
Alternatives include manually writing client-side validation with libraries like VeeValidate (Vue) or Yup (React), or using Laravel Nova’s built-in validation features if you’re on Laravel Forge/Fortify. For a Laravel-centric approach without jQuery, consider building a custom solution with Alpine.js and Laravel’s API validation endpoints.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony