<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use App\Models\User;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Number of users to seed
        $numberOfUsers = 5;

        for ($i = 1; $i <= $numberOfUsers; $i++) {
            User::create([
                'role_id' => 3, // Default role
                'department_id' => rand(1, 5), // Random department between 1 and 5
                'name' => 'User ' . $i, // Unique name
                'email' => 'user' . $i . '@example.com', // Unique email
                'email_verified_at' => null, // Email not verified
                'password' => Hash::make('password123'), // Default hashed password
                'orcid_id' => sprintf('%04d-%04d-%04d-%04d', rand(1000, 9999), rand(1000, 9999), rand(1000, 9999), rand(1000, 9999)), // Fake ORCID iD
                'scopus_id' => rand(10000000000, 99999999999), // Random 11-digit Scopus ID
                'mobile_no' => '+91' . rand(6000000000, 9999999999), // Random Indian mobile number
                'extension' => rand(1000, 9999), // 4-digit extension
                'remember_token' => null, // Null for remember token
            ]);
        }
    }
}
