File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 5
5
'instance_id ' => env ('Z_API_INSTANCE_ID ' , '' ),
6
6
'instance_token ' => env ('Z_API_INSTANCE_TOKEN ' , '' ),
7
7
'test_phone ' => env ('Z_API_TEST_PHONE ' , null ),
8
+ 'client_token ' => env ('Z_API_CLIENT_TOKEN ' , '' ),
8
9
];
Original file line number Diff line number Diff line change @@ -27,15 +27,17 @@ class ZAPIService
27
27
/**
28
28
* ZAPIService constructor.
29
29
*/
30
- public function __construct ($ instanceId = null , $ instanceToken = null )
30
+ public function __construct ($ instanceId = null , $ instanceToken = null , $ clientToken = null )
31
31
{
32
32
$ instanceId = $ instanceId ?? Config::get ('z-api.instance_id ' );
33
33
$ instanceToken = $ instanceToken ?? Config::get ('z-api.instance_token ' );
34
+ $ clientToken = $ clientToken ?? Config::get ('z-api.client_token ' );
34
35
35
36
$ this ->http = Http::withoutVerifying ()
36
37
->baseUrl (Config::get ('z-api.host ' ) . "/instances/ $ instanceId/token/ $ instanceToken " )
37
38
->withHeaders ([
38
39
'Cache-Control ' => 'no-cache ' ,
40
+ 'Client-Token ' => $ clientToken ,
39
41
]);
40
42
41
43
$ this ->instance = new InstanceEndpoint ($ this ->http );
You can’t perform that action at this time.
0 commit comments