<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class UserSeeder extends Seeder
{
    public function run()
    {
        $data = [
            [
                'username'   => 'mas_asysyarif',
                'password'   => password_hash('Mas12345t', PASSWORD_DEFAULT),
                'nama'       => 'Administrator',
                'role'       => 'petugas',
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
            [
                'username'   => 'guru',
                'password'   => password_hash('Guru12345', PASSWORD_DEFAULT),
                'nama'       => 'Guru Contoh',
                'role'       => 'guru',
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
            [
                'username'   => 'siswa',
                'password'   => password_hash('Siswa12345', PASSWORD_DEFAULT),
                'nama'       => 'Siswa Contoh',
                'role'       => 'siswa',
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
        ];

        $this->db->table('users')->insertBatch($data);
    }
}