added kashkool 3

This commit is contained in:
2026-06-12 19:14:15 +03:30
parent ebaeb441c5
commit 7b18009e9b
3 changed files with 46 additions and 7 deletions
+7 -3
View File
@@ -22,10 +22,14 @@ class ConfigService
*/
public function get(string $key, $default = null)
{
$row = Setting::where('key', $key)->first();
try {
$row = Setting::where('key', $key)->first();
if ($row !== null && $row->is_active && $row->value !== null && $row->value !== '') {
return $row->value;
if ($row !== null && $row->is_active && $row->value !== null && $row->value !== '') {
return $row->value;
}
} catch (\Throwable $e) {
// DB در دسترس نیست (deploy / .env اشتباه) — از config/price_providers.php استفاده شود
}
$fromFile = config("price_providers.{$key}");