added kashkool 3
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user