Skip to content

Commit aa9746c

Browse files
authored
Document setting custom validation message
1 parent 0c174d8 commit aa9746c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ The following code snippet shows an example of how to use the password exposed v
2929
use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;
3030

3131
$request->validate([
32-
'password' => ['required', new PasswordExposed],
32+
'password' => ['required', new PasswordExposed()],
33+
]);
34+
```
35+
36+
If you wish, you can also set a custom validation message, as shown below.
37+
38+
```php
39+
use DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed;
40+
41+
$request->validate([
42+
'password' => ['required', (new PasswordExposed())->setMessage('This password is not secure.')],
3343
]);
3444
```

0 commit comments

Comments
 (0)