- Fixed get crm info when client used in laravel
This commit is contained in:
parent
f36447854b
commit
03501c156e
2 changed files with 5 additions and 1 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"type": "library",
|
||||
"description": "LDC CRM Client V2",
|
||||
"license": "MIT",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jérémy Munsch",
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ class ApiInterface
|
|||
self::$bearerToken = self::$bearerToken ?: $bearerToken;
|
||||
self::$bearerPwd = self::$bearerPwd ?: $bearerPwd;
|
||||
|
||||
static::$bearerToken = static::$bearerToken ?: Utils::getConfig('crm.token');
|
||||
static::$bearerPwd = static::$bearerPwd ?: Utils::getConfig('crm.password');
|
||||
static::$endpoint = static::$endpoint ?: Utils::getConfig('crm.endpoint');
|
||||
|
||||
if (!self::$bearerToken or !self::$bearerPwd or !self::$endpoint) {
|
||||
throw new CrmException(
|
||||
'Either config or .env file need to have the token var set (crm.token, crm.password, crm.endpoint)'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue