Skip to content

Commit

Permalink
Add .env support to the talk config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Guklam committed Oct 13, 2019
1 parent 3ff6a9d commit bcfee52
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,18 +532,22 @@ return [
],
'broadcast' => [
'enable' => false,
'app_name' => 'your-app-name',
'app_name' => env('PUSHER_APP_NAME'),
'pusher' => [
'app_id' => '',
'app_key' => '',
'app_secret' => ''
]
]
'app_id' => env('PUSHER_APP_ID'),
'app_key' => env('PUSHER_APP_KEY'),
'app_secret' => env('PUSHER_APP_SECRET'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true
]
],
],
];
```

in this new version broadcast section was added with talk config. Here broadcast is disabled by default.
If you want to enable live (realtime) messaging then you have to enable it first. Then add pusher credentials. Thats it. Everytime
If you want to enable live (realtime) messaging then you have to enable it first. Then add pusher credentials to your .env file and you must add a new line called PUSHER_APP_NAME in the .env file to specify your application pusher name. Thats it. Everytime
when you send message then talk will automatically fire two event, one for specific user and second for specific conversation. So
you may listen or subscribe one or both as per your wish. Finally you have to subscribe these events by using `talk_live()` helper function.
Go to where you want to subscribe to work with message data follow this code.
Expand Down
10 changes: 5 additions & 5 deletions config/talk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
],
'broadcast' => [
'enable' => false,
'app_name' => 'your-app-name',
'app_name' => env('PUSHER_APP_NAME'),
'pusher' => [
'app_id' => '',
'app_key' => '',
'app_secret' => '',
'app_id' => env('PUSHER_APP_ID'),
'app_key' => env('PUSHER_APP_KEY'),
'app_secret' => env('PUSHER_APP_SECRET'),
'options' => [
'cluster' => 'ap1',
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true
]
],
Expand Down

0 comments on commit bcfee52

Please sign in to comment.