<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class UsersTableSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        User::factory()->create([
            'id' => 1,
            'username' => 'nurmuhammet',

            'name' => 'Nurmuhammet Allanov',
            'first_name' => 'Nurmuhammet',
            'last_name' => 'Allanov',

            'email' => 'nurmuhammet@mail.com',
            'email_verified_at' => now(),

            'phone' => 61929248,
            'phone_verified_at' => now(),

            'password' => bcrypt('payload10'),

            'must_fill_profile' => true,
        ]);

        DB::statement("SELECT setval('users_id_seq', (SELECT MAX(id) from users));");
        DB::statement("SELECT nextval('users_id_seq');");

        User::factory()->count(3)->create(['password' => bcrypt('payload10')]);
    }
}
