fix(settings): read SuperAdmin overlay via ConfigService everywhere
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -21,8 +20,9 @@ class ChatWebhookService
|
||||
public function ensureRegisteredDetailed(int $maxAttempts = 3): array
|
||||
{
|
||||
$webhookUrl = $this->webhookUrl();
|
||||
$chatApi = Controller::Config('chat_api');
|
||||
$chatApiKey = Controller::Config('chat_api_key');
|
||||
$config = app(ConfigService::class);
|
||||
$chatApi = $config->getString('chat_api');
|
||||
$chatApiKey = $config->getString('chat_api_key');
|
||||
|
||||
if (! $chatApi || ! $chatApiKey) {
|
||||
return [
|
||||
@@ -128,7 +128,7 @@ class ChatWebhookService
|
||||
*/
|
||||
public function webhookUrl(): string
|
||||
{
|
||||
$base = trim((string) Controller::Config('chat_webhook_base_url'));
|
||||
$base = trim(app(ConfigService::class)->getString('chat_webhook_base_url'));
|
||||
if ($base === '' || $base === '0' || strtolower($base) === 'false') {
|
||||
$base = rtrim((string) config('app.url'), '/');
|
||||
} else {
|
||||
@@ -154,7 +154,7 @@ class ChatWebhookService
|
||||
|
||||
public function ensureSecret(): string
|
||||
{
|
||||
$existing = $this->sanitizeSecret((string) Controller::Config('chat_webhook_secret'));
|
||||
$existing = $this->sanitizeSecret(app(ConfigService::class)->getString('chat_webhook_secret'));
|
||||
if ($existing !== '') {
|
||||
return $existing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user