You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
#Laravalid
2
-
#### Laravel Validation For Client Side
1
+
#Laravalid + Ardent
2
+
#### Laravel Validation For Client Side, using self-validating smart models from Ardent
3
3
4
-
This package makes validation rules defined in laravel work client-side by converting to html/js plugins such as jquery validation. It also allows to use laravel validation messages so you can show same messages for both sides.
4
+
This package makes validation rules defined in Laravel work in the client by converting validation rules to HTML + JS plugins (such as jQuery Validation). It also allows you to use Laravel validation messages so you can show the same messages on both sides.
5
5
6
6
7
7
### Table of contents
@@ -73,15 +73,16 @@ After publishing configuration file, you can find it in config/laravalid folder.
73
73
74
74
### Usage
75
75
76
-
The package uses laravel Form Builder to make validation rules work for both sides. Therefore you should use Form Builder. While opening form by using Form::open you can give $rules as second parameter:
76
+
The package uses Laravel Form Builder to make validation rules work for both sides. While opening a form by using `Form::open` you can pass the $rules as the second parameter:
Form::close(); // don't forget to close form, it reset validation rules
84
84
```
85
+
85
86
Also if you don't want to struggle with $rules at view files, you can set it in Controller or route with or without form name by using Form::setValidation($rules, $formName). If you don't give form name, this sets rules for first Form::open
86
87
```php
87
88
// in controller or route
@@ -99,6 +100,16 @@ For rules which is related to input type in laravel (such as max, min), the pack
99
100
```
100
101
The converter assume input is string by default. File type is not supported yet.
101
102
103
+
#### Usage with Ardent
104
+
105
+
The magic from this package extension, though, comes from the integration with Ardent models. Here are two ways to use it with Ardent (the second being the preferred one):
Converter uses validation messages of laravel (app/lang/en/validation.php) by default for client-side too. If you want to use jquery validation messages, you can set useLaravelMessages, false in config file of package which you copied to your config dir.
0 commit comments