mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
32 lines
778 B
PHP
Executable File
32 lines
778 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Services\Helpers;
|
|
|
|
use App\Enums\IntegratedServices;
|
|
|
|
class IntegrationHelper
|
|
{
|
|
public static function getSettings(): array
|
|
{
|
|
return once(fn () => SettingsHelper::getSetting('integrated_services', []));
|
|
}
|
|
|
|
public static function setSettings(array $settings): void
|
|
{
|
|
SettingsHelper::setSetting('integrated_services', $settings);
|
|
}
|
|
|
|
public static function getSearchSettings(): array
|
|
{
|
|
return data_get(self::getSettings(), IntegratedServices::SearXng->value, []);
|
|
}
|
|
|
|
public static function isSearchEnabled(): bool
|
|
{
|
|
$searchSettings = self::getSearchSettings();
|
|
|
|
return data_get($searchSettings, 'enabled', false)
|
|
&& data_get($searchSettings, 'url', null);
|
|
}
|
|
}
|