added notif
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* سوییچ اعلان / هشدار قیمت برای اپ کاربر — پیشفرض false، can_edit=0.
|
||||
* value ردیف موجود را تغییر نمیدهد.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$key = 'has_page_price_trigger';
|
||||
$meta = [
|
||||
'title_fa' => 'اعلان (هشدار قیمت)',
|
||||
'description' => 'روشن: منوی هشدار قیمت (اعلان) در اپ کاربر نمایش داده میشود. خاموش: منو و صفحه مخفی است. فقط از دیپلوی قابل تغییر است.',
|
||||
'type' => 'switch',
|
||||
];
|
||||
|
||||
$exists = DB::table('settings')->where('key', $key)->exists();
|
||||
if (! $exists) {
|
||||
DB::table('settings')->insert([
|
||||
'key' => $key,
|
||||
'value' => 'false',
|
||||
'title_fa' => $meta['title_fa'],
|
||||
'can_edit' => 0,
|
||||
'is_active' => 1,
|
||||
'description' => $meta['description'],
|
||||
'type' => $meta['type'],
|
||||
]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DB::table('settings')->where('key', $key)->update([
|
||||
'title_fa' => $meta['title_fa'],
|
||||
'description' => $meta['description'],
|
||||
'type' => $meta['type'],
|
||||
'can_edit' => 0,
|
||||
'is_active' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// کلید را حذف نمیکنیم — ممکن است مقدار ادمین داشته باشد.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user