<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        //
        $roleAdmin = Role::create(['name' => 'admin']);
        $roleUser = Role::create(['name' => 'usuario']);

        Permission::create(['name' => 'index.usuarios'])->syncRoles([$roleAdmin]);
        Permission::create(['name' => 'create.usuarios'])->syncRoles([$roleAdmin]);
        Permission::create(['name' => 'edit.usuarios'])->syncRoles([$roleAdmin]);

    }
}
