скрытие магазина
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class StoreAvailabilityService
|
||||
{
|
||||
private const CONFIG_ID = 1;
|
||||
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return (bool) DB::connection('store')
|
||||
->table('store_config')
|
||||
->where('id', self::CONFIG_ID)
|
||||
->value('enabled');
|
||||
}
|
||||
|
||||
public function setEnabled(bool $enabled): void
|
||||
{
|
||||
DB::connection('store')
|
||||
->table('store_config')
|
||||
->where('id', self::CONFIG_ID)
|
||||
->update(['enabled' => (int) $enabled]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user