Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 76997f0

Browse files
committed
docs: fixing NS and explaining laravalid.action config
1 parent 6ee93fb commit 76997f0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,23 @@ Require `bllim/laravel-validation-for-client-side` in composer.json and run `com
4444

4545
> **Note:** For **Laravel 4** use `laravel4` branch: `"laravel-ardent/laravalid": "dev-laravel4"`
4646
47-
Composer will download the package. After the package is downloaded, open `config/app.php` and add the service provider and alias as below:
47+
Composer will download the package. After that, open `config/app.php` and add the service provider and aliases:
4848
```php
49-
'providers' => array(
49+
'providers' => [
5050
...
51-
'Bllim\Laravalid\LaravalidServiceProvider',
52-
),
53-
```
54-
```php
55-
'aliases' => array(
51+
'LaravelArdent\Laravalid\LaravalidServiceProvider',
52+
],
53+
54+
'aliases' => [
5655
...
57-
'HTML' => 'Illuminate\Support\Facades\HTML', // if not exists add for html too
58-
'Form' => 'Bllim\Laravalid\Facade',
59-
),
56+
'HTML' => 'Illuminate\Support\Facades\HTML',
57+
'Form' => 'LaravelArdent\Laravalid\Facade',
58+
],
6059
```
6160

6261
Also you need to publish configuration file and assets by running the following Artisan commands.
6362
```php
64-
$ php artisan vendor:publish
63+
$ ./artisan vendor:publish
6564
```
6665

6766
### Configuration
@@ -70,8 +69,9 @@ After publishing configuration file, you can find it in config/laravalid folder.
7069
| Parameter | Description | Values |
7170
|-----------|-------------|--------|
7271
| plugin | Choose plugin you want to use | See [Plugins and Supported Rules](#plugins-and-supported-rules) |
73-
| useLaravelMessages | If it is true, laravel validation messages are used in client side otherwise messages of chosen plugin are used | true/false |
74-
| route | Route name for remote validation | Any route name (default: laravalid) |
72+
| useLaravelMessages | If it is true, laravel validation messages are used in client side otherwise messages of chosen plugin are used | `boolean`. See [Validation Messages](#validation-messages) |
73+
| route | Route name for remote validation | Any route name (default: laravalid). The route will receive an argument named `rule` |
74+
| action | A custom action to run the remote validation procedure | An action string, such as `SiteController@getValidation`. You must create that action if you plan to run remote validations. This is needed if you want to cache routes (`./artisan route:cache`)
7575

7676
#### Validation Messages
7777
If you set `useLaravelMessages` to `true`, you're able to use (Laravel's Localization package)[l10n] to generate validation messages. To do so, follow the [docs][l10n] to get the package configured (by setting your default/fallback/current locales). Then, create a folder for each locale (as the docs says) and create a `validation.php` file for each one. Inside those files you'll set a message for each rule name, as follows:

0 commit comments

Comments
 (0)