Skip to content

Commit 517f1e3

Browse files
committed
Add instructions on how to specify a db connection to a rule
1 parent a8a12e5 commit 517f1e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ $attributes = request()->validate([
9494
]);
9595
```
9696

97+
### Specify a Database Connection
98+
99+
If you are using multiple database connections, you can specify which one to use by prepending it to the table name, separated by a dot:
100+
101+
```php
102+
$attributes = request()->validate([
103+
'slug.*' => 'unique_translation:db_connection.posts',
104+
// or...
105+
'slug.*' => UniqueTranslationRule::for('db_connection.posts'),
106+
]);
107+
```
108+
97109
### Ignore a Record with ID
98110

99111
If you're updating a record, you may want to ignore the post itself from the unique check.

0 commit comments

Comments
 (0)