fix(settings): read SuperAdmin overlay via ConfigService everywhere
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Services\SmsBilling;
|
||||
use App\Models\Setting;
|
||||
use App\Models\SmsWallet;
|
||||
use App\Models\User;
|
||||
use App\Services\ConfigService;
|
||||
|
||||
class SmsAlertService
|
||||
{
|
||||
@@ -35,7 +36,7 @@ class SmsAlertService
|
||||
return;
|
||||
}
|
||||
|
||||
$appName = trim((string) Setting::where('key', 'name_fa')->value('value'));
|
||||
$appName = trim(app(ConfigService::class)->getString('name_fa'));
|
||||
if ($appName === '') {
|
||||
$appName = 'این نسخه';
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Services\SmsBilling;
|
||||
|
||||
use App\Exceptions\SmsBlockedException;
|
||||
use App\Models\Setting;
|
||||
use App\Services\ConfigService;
|
||||
use App\Services\SmsBilling\Contracts\SmsProviderInterface;
|
||||
use App\Services\SmsBilling\Providers\CentralSmsApiProvider;
|
||||
use App\Services\SmsBilling\Providers\MeliPayamakProvider;
|
||||
@@ -188,12 +188,14 @@ class SmsGatewayService
|
||||
|
||||
private function buildProviderConfig(): array
|
||||
{
|
||||
$config = app(ConfigService::class);
|
||||
|
||||
return [
|
||||
'melipayamak_user' => Setting::where('key', 'melipayamak_user')->value('value'),
|
||||
'melipayamak_password' => Setting::where('key', 'melipayamak_password')->value('value'),
|
||||
'melipayamak_from' => Setting::where('key', 'melipayamak_from')->value('value'),
|
||||
'name_fa' => Setting::where('key', 'name_fa')->value('value'),
|
||||
'name_en' => Setting::where('key', 'name_en')->value('value'),
|
||||
'melipayamak_user' => $config->getString('melipayamak_user'),
|
||||
'melipayamak_password' => $config->getString('melipayamak_password'),
|
||||
'melipayamak_from' => $config->getString('melipayamak_from'),
|
||||
'name_fa' => $config->getString('name_fa'),
|
||||
'name_en' => $config->getString('name_en'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Models\Setting;
|
||||
use App\Models\SmsLedger;
|
||||
use App\Models\SmsSendLog;
|
||||
use App\Models\SmsWallet;
|
||||
use App\Services\ConfigService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -36,7 +37,7 @@ class SmsWalletService
|
||||
/** Billing/panel فعال است مگر sms_panel صریحاً false باشد. */
|
||||
public static function isBillingEnabled(): bool
|
||||
{
|
||||
$value = Setting::where('key', 'sms_panel')->value('value');
|
||||
$value = app(ConfigService::class)->getString('sms_panel');
|
||||
|
||||
if ($value === null || trim((string) $value) === '') {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user