add sync data setting
This commit is contained in:
@@ -29,10 +29,15 @@ class ServiceSIMBG
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->email = trim((string) GlobalSetting::where('key','SIMBG_EMAIL')->firstOrFail()->value);
|
||||
$this->password = trim((string) GlobalSetting::where('key','SIMBG_PASSWORD')->firstOrFail()->value);
|
||||
$this->simbg_host = trim((string)GlobalSetting::where('key','SIMBG_HOST')->firstOrFail()->value);
|
||||
$this->fetch_per_page = trim((string)GlobalSetting::where('key','FETCH_PER_PAGE')->firstOrFail()->value);
|
||||
$settings = GlobalSetting::whereIn('key', [
|
||||
'SIMBG_EMAIL', 'SIMBG_PASSWORD', 'SIMBG_HOST', 'FETCH_PER_PAGE'
|
||||
])->pluck('value', 'key');
|
||||
|
||||
$this->email = trim((string) ($settings['SIMBG_EMAIL'] ?? ""));
|
||||
$this->password = trim((string) ($settings['SIMBG_PASSWORD'] ?? ""));
|
||||
$this->simbg_host = trim((string) ($settings['SIMBG_HOST'] ?? ""));
|
||||
$this->fetch_per_page = trim((string) ($settings['FETCH_PER_PAGE'] ?? ""));
|
||||
|
||||
$this->service_client = new ServiceClient($this->simbg_host);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user