<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class UserSeeder extends Seeder
{
    public function run()
    {
        $data = [
            [
                'username' => 'admin',
                'email' => 'prithvirajmudiliyar@gmail.com',
                'password' => password_hash('Admin@123', PASSWORD_DEFAULT), // Hash the password directly
                'role'     => 'admin',
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
            [
                'username' => 'superadmin',
                'email' => 'solankimoulik18@gmail.com',
                'password' => password_hash('Super@123', PASSWORD_DEFAULT), // Hash the password directly
                'role'     => 'superadmin',
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
        ];

        // Simple insert without using the model to avoid issues
        $this->db->table('users')->insertBatch($data);
    }
}