<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // 运行角色和权限填充器
        $this->call(RoleSeeder::class);

        // 创建管理员用户
        $admin = User::create([
            'name' => 'Admin User',
            'email' => 'admin@example.com',
            'password' => Hash::make('password'),
            'active' => true,
        ]);
        $admin->assignRole('admin');

        // 创建员工用户
        $staff = User::create([
            'name' => 'Staff User',
            'email' => 'staff@example.com',
            'password' => Hash::make('password'),
            'active' => true,
        ]);
        $staff->assignRole('staff');

        // 创建股东用户
        $shareholder = User::create([
            'name' => 'Shareholder User',
            'email' => 'shareholder@example.com',
            'password' => Hash::make('password'),
            'active' => true,
        ]);
        $shareholder->assignRole('shareholder');
    }
}
