<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Faker\Factory as Faker;

class CobaSeeder extends Seeder
{
    public function run()
    {
        $faker = Faker::create();

        for ($i = 0; $i < 10; $i++) {
            DB::table('coba')->insert([
                'ultrasonik' => $faker->randomFloat(2, 0, 100), // Data float acak antara 0 dan 100 dengan 2 desimal
                'tanggal' => now() // Menyimpan waktu saat ini
            ]);
            echo "Inserted record $i\n";
        }
    }
}
