<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        Role::updateOrCreate([
            'name' => 'Super Admin',
            'guard_name' => 'web',
        ]);

        // // newly added role
        // $role_admin = Role::create([
        //     'name' => 'admin',
        //     'guard_name' => 'web',
        // ]);
        // $permission_manage_users = Permission::firstOrCreate([
        //     'name' => 'manage users',
        //     'guard_name' => 'web',
        // ]);

        // $role_admin->givePermissionTo($permission_manage_users);

        // $user = User::find(10);

        // $user->assignRole($role_admin);
    }
}
