Skip to content

Commit e4f11b6

Browse files
committed
update readme
1 parent e3d7609 commit e4f11b6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ return [
9999
'pusher' => [
100100
'app_id' => '',
101101
'app_key' => '',
102-
'app_secret' => ''
102+
'app_secret' => '',
103+
'options' => [
104+
'cluster' => 'ap1',
105+
'encrypted' => true
106+
]
103107
]
104108
]
105109
];
@@ -108,7 +112,18 @@ return [
108112

109113
### Usage
110114

111-
Its very easy to use. First you have to set authenticate user id to Talk as globally.
115+
Its very easy to use. If you want to set authenticate user id globally then you have to set a middleware first. Go to `app/Http/Kernel.php` and set it in `$routeMiddleware` array
116+
117+
```php
118+
'talk' => \Nahid\Talk\Middleware\TalkMiddleware::class,
119+
```
120+
And now you can use it from anywhere with middleware. Suppose you have a Controller and you want to set authenticate user id globally then write this in controller constructor
121+
122+
```php
123+
$this->middleware('talk');
124+
```
125+
126+
But instead of set id globally you can use these procedure from any method in controller.
112127

113128
```php
114129
Talk::setAuthUserId(auth()->user()->id);

0 commit comments

Comments
 (0)