<?php

namespace Database\Seeders;

use App\Models\DataSetting;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DataSettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $data_settings = [
            [
            "key" => "TARGET_PAD",
            "value" => "50000000000",
            "type" => "integer"
            ],
            [
            "key" => "TATA_RUANG",
            "value" => "10000000000",
            "type" => "integer"
            ]
        ];

        foreach ($data_settings as $setting) {
            DataSetting::updateOrCreate([
                "key" => $setting["key"],
            ],[
                "value" => $setting["value"],
                "type" => $setting["type"],
                "created_at" => now(),
                "updated_at" => now(),
            ]);
        }
    }
}
