@@ -13,7 +13,8 @@ Guarantee database stickiness over the same user's consecutive requests.
13
13
composer require mpyw/laravel-cached-database-stickiness
14
14
```
15
15
16
- The default implementation is provided by ` ConnectionServiceProvider ` , however, ** package discovery is not available** .
16
+ > [ !IMPORTANT]
17
+ > The default implementation is provided by ` ConnectionServiceProvider ` , however, ** package discovery is not available** .
17
18
Be careful that you MUST register it in ** ` config/app.php ` ** by yourself.
18
19
19
20
``` php
@@ -75,8 +76,9 @@ This library provides the following features.
75
76
76
77
### Customize Stickiness TTL
77
78
78
- The default stickiness TTL is ` 5 ` seconds.
79
- You can configure this value to add ** ` stickiness_ttl ` ** directive to your ` config/database.php ` .
79
+ > [ !NOTE]
80
+ > The default stickiness TTL is ` 5 ` seconds.
81
+ > You can configure this value to add ** ` stickiness_ttl ` ** directive to your ` config/database.php ` .
80
82
81
83
``` php
82
84
<?php
@@ -131,10 +133,10 @@ return [
131
133
132
134
### Customize Connection Implementation
133
135
134
- You can configure Connection implementation.
135
-
136
- - Make sure ` ConnectionServiceProvider ` to be removed from ` config/app.php ` .
137
- - Extend Connection with ` DispatchesConnectionEvents ` trait by yourself.
136
+ > [ !TIP ]
137
+ > You can configure Connection implementation.
138
+ > - Make sure ` ConnectionServiceProvider ` to be removed from ` config/app.php ` .
139
+ > - Extend Connection with ` DispatchesConnectionEvents ` trait by yourself.
138
140
139
141
``` php
140
142
<?php
@@ -172,7 +174,8 @@ class MySqlConnection extends BaseMySqlConnection
172
174
173
175
### Customize Stickiness Source
174
176
175
- You can register the ` StickinessResolverInterface ` implementation to change the source for stickiness determination.
177
+ > [ !TIP]
178
+ > You can register the ` StickinessResolverInterface ` implementation to change the source for stickiness determination.
176
179
177
180
``` php
178
181
<?php
@@ -197,7 +200,8 @@ class DatabaseServiceProvider extends ServiceProvider
197
200
| ` IpBasedResolver ` <br >** (Default)** | Remote IP address | |
198
201
| ` AuthBasedResolver ` | Authenticated User ID | Required |
199
202
200
- You must add ** ` ResolveStickinessOnResolvedConnections ` ** middleware after ` Authenticate `
203
+ > [ !IMPORTANT]
204
+ > You must add ** ` ResolveStickinessOnResolvedConnections ` ** middleware after ` Authenticate `
201
205
when you use ` AuthBasedResolver ` .
202
206
203
207
``` diff
@@ -271,7 +275,8 @@ when you use `AuthBasedResolver`.
271
275
272
276
### Customize Worker Behavior
273
277
274
- You can register the ` JobInitializerInterface ` implementation to change workers' behavior.
278
+ > [ !TIP]
279
+ > You can register the ` JobInitializerInterface ` implementation to change workers' behavior.
275
280
276
281
``` php
277
282
<?php
@@ -298,7 +303,8 @@ class DatabaseServiceProvider extends ServiceProvider
298
303
299
304
## Attention
300
305
301
- ### Don't call ` Schema::defaultStringLength() ` in ` ServiceProvider::boot() `
306
+ > [ !CAUTION]
307
+ > ### Don't call ` Schema::defaultStringLength() ` in ` ServiceProvider::boot() `
302
308
303
309
#### Problem
304
310
0 commit comments