Просмотр файла database/upgrades/2025_07_16_012620_add_comment_point_to_settings.php

Размер файла: 692B
<?php

use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration {
    public function up(): void
    {
        Setting::query()->where('name', 'comment_point')->updateOrCreate([], [
            'name'  => 'comment_point',
            'value' => 1,
        ]);

        Setting::query()->where('name', 'comment_money')->updateOrCreate([], [
            'name'  => 'comment_money',
            'value' => 50,
        ]);

        clearCache('settings');
    }

    public function down(): void
    {
        Setting::query()->where('name', 'comment_point')->delete();
        Setting::query()->where('name', 'comment_money')->delete();
    }
};