- Fixed get crm info when client used in laravel

This commit is contained in:
Jérémy Munsch 2022-02-10 09:39:51 +01:00
parent f36447854b
commit 03501c156e
No known key found for this signature in database
GPG key ID: 55196BEE445F6049
2 changed files with 5 additions and 1 deletions

View file

@ -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",

View file

@ -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)'