Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid committed Apr 22, 2017
1 parent e3d7609 commit e4f11b6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ return [
'pusher' => [
'app_id' => '',
'app_key' => '',
'app_secret' => ''
'app_secret' => '',
'options' => [
'cluster' => 'ap1',
'encrypted' => true
]
]
]
];
Expand All @@ -108,7 +112,18 @@ return [

### Usage

Its very easy to use. First you have to set authenticate user id to Talk as globally.
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

```php
'talk' => \Nahid\Talk\Middleware\TalkMiddleware::class,
```
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

```php
$this->middleware('talk');
```

But instead of set id globally you can use these procedure from any method in controller.

```php
Talk::setAuthUserId(auth()->user()->id);
Expand Down

0 comments on commit e4f11b6

Please sign in to comment.