<?php

namespace Database\Seeders;

use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        if (Schema::hasTable('personal_access_tokens')) {
            DB::table('personal_access_tokens')->delete();
        }

        User::query()->delete();

        User::create([
            'name' => 'Admin',
            'email' => 'admin@admin.com',
            'password' => 'admin123',
            'role' => 'admin',
            'team' => 'qa',
        ]);

        User::create([
            'name' => 'Hassan Ali',
            'email' => 'hassanali@qa.com',
            'password' => 'qa123',
            'role' => 'admin',
            'team' => 'qa',
        ]);

        User::create([
            'name' => 'Project User',
            'email' => 'project@codeblue.com',
            'password' => 'project123',
            'role' => 'project',
            'team' => 'qa',
        ]);
    }
}
