added notif

This commit is contained in:
2026-07-23 21:41:51 +03:30
parent 8a4a406e66
commit 69b7ba69b9
3 changed files with 72 additions and 7 deletions
@@ -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
{
// کلید را حذف نمی‌کنیم — ممکن است مقدار ادمین داشته باشد.
}
};