Download the PHP package mrpunyapal/laravel-client-validation without Composer
On this page you can find all versions of the php package mrpunyapal/laravel-client-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrpunyapal/laravel-client-validation
More information about mrpunyapal/laravel-client-validation
Files in mrpunyapal/laravel-client-validation
Package laravel-client-validation
Short Description Laravel validation rules for client-side with Alpine.js integration
License MIT
Homepage https://mrpunyapal.github.io/laravel-client-validation/
Informations about the package laravel-client-validation
Laravel Client Validation
A powerful validation package that brings Laravel validation rules to the client-side. Validate forms in real-time using the same rules you know from Laravel — works with any backend or as a standalone NPM package.
Features
- 104 client-side rules — Comprehensive coverage of Laravel validation rules
- 5 remote rules — Server-side AJAX validation for
unique,exists, etc. - TypeScript declarations — Full type definitions for IDE autocompletion
- Laravel 12/13 support — Compatible with the latest Laravel versions
- Livewire v3 & v4 — Automatic version detection and optimized integration
- Filament v3 & v5 — Panel plugin with field-level validation
- Backend-agnostic — Use with Laravel, Django, Express, Rails, or any backend
- Multiple integrations — Alpine.js, Livewire, Filament, Vanilla JS, React, Vue
- Real-time validation — Instant feedback on blur, input, or submit
- FormRequest support — Extract rules from existing Laravel FormRequest classes
- Validation hooks —
beforeValidate,afterValidate, field-level events - Bail support — Stop on first failure per field with
bailrule - Batch validation — Validate multiple fields in a single AJAX request
- Rate limiting — Built-in request throttling for AJAX validation
- Zero configuration — Works out of the box with sensible defaults
- Tree-shakeable — ES module subpath exports for minimal bundle size
Quick Start
Option A: Laravel Package (Composer)
Laravel Boost
If your Laravel project uses Laravel Boost, this package ships a third-party Boost skill for package-aware code generation and debugging.
Install Boost if needed:
If Boost is already installed in the app, refresh package-provided skills after adding or updating this package:
When skills are enabled, Boost can install the laravel-client-validation-development skill and guide AI agents toward the package's recommended Blade, Alpine, Livewire, Filament, and remote-validation patterns.
Option B: Standalone NPM Package
Import only what you need:
Option C: CDN / Script Tag
Usage with Alpine.js
Simple Field Validation
Complete Form Component
Available Methods in validation() Component
| Method | Description |
|---|---|
validate('field') |
Validate a single field |
validateAll() |
Validate all fields |
submit(callback) |
Validate then call callback if valid |
error('field') |
Get first error for field |
hasError('field') |
Check if field has errors |
hasErrors() |
Check if any errors exist |
isValid() |
Check if form is valid |
clearError('field') |
Clear errors for field |
reset() |
Reset form to initial state |
Usage with Livewire
Supports both Livewire v3 and v4. Version is detected automatically.
Using the x-wire-validate Directive
Using the PHP Trait
In your Blade view:
Livewire Events
Usage with Filament
Register the Plugin
Add Validation to Fields
Use the HasClientValidation trait on your custom Filament fields:
Or use the pre-built ClientValidatedField:
Usage with Vanilla JS (No Framework)
Using Data Attributes
Programmatic Validation
Using Blade Directives
Using with FormRequest
In Controller
In Blade
Backend-Agnostic Remote Validation
The RemoteValidator works with any backend, not just Laravel. Configure it for your stack:
Express.js / Node
Django
Custom Adapter
Validation Rules
Client-Side Rules (104 — Instant)
Core: required, nullable, filled, present, bail
String: string, email, url, active_url, alpha, alpha:ascii, alpha_num, alpha_num:ascii, alpha_dash, alpha_dash:ascii, regex, not_regex, contains, doesnt_contain, lowercase, uppercase, starts_with, ends_with, doesnt_start_with, doesnt_end_with, ascii, uuid, uuid:version, ulid, json, hex_color
Numeric: numeric, numeric:strict, integer, integer:strict, decimal, multiple_of, digits, digits_between, min_digits, max_digits
Size: min, max, between, size
Comparison: confirmed, confirmed:field, same, different, gt, gte, lt, lte, in, not_in, enum
Date: date, after, before, after_or_equal, before_or_equal, date_equals, date_format, timezone
Conditional: required_if, required_unless, required_with, required_without, required_with_all, required_without_all, required_if_accepted, required_if_declined, required_array_keys
Presence / Missing: present_if, present_unless, present_with, present_with_all, missing, missing_if, missing_unless, missing_with, missing_with_all
Prohibition: prohibited, prohibited_if, prohibited_unless, prohibited_if_accepted, prohibited_if_declined, prohibits
Boolean: boolean, boolean:strict, accepted, accepted_if, declined, declined_if
Network: ip, ipv4, ipv6, mac_address
Array: array, distinct, in_array, in_array_keys, list
File: file, image, mimes, mimetypes, extensions, dimensions
Advanced: any_of, password_strength
Remote Rules (5 — AJAX)
unique, exists, password, current_password, encoding
See docs/md/validation-rules.md for the canonical validation rules guide and examples.
Configuration
Key options:
Validation Hooks
Custom Rules
Client-Side
Server-Side (PHP)
NPM Subpath Exports
| Import Path | Contents |
|---|---|
laravel-client-validation |
Full bundle (all adapters) |
laravel-client-validation/core |
LaravelValidator, RuleRegistry, RemoteValidator, EventEmitter |
laravel-client-validation/alpine |
Alpine.js x-validate directive |
laravel-client-validation/vanilla |
Vanilla JS data-validate form validator |
laravel-client-validation/livewire |
Livewire adapter |
laravel-client-validation/react |
React hook adapter |
laravel-client-validation/vue |
Vue composable adapter |
Examples
See the examples/ directory for complete demos:
- Alpine.js demo
- Vanilla JS demo
- Livewire demo
Testing
License
The MIT License (MIT). See License File for more information.
All versions of laravel-client-validation with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.16