<?php
namespace Sargilla\FlatLab\Seeds;

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

class RolesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
     	app()['cache']->forget('spatie.permission.cache');
    	
        Permission::create(['name'=>'admin-usuarios']);
        Permission::create(['name'=>'admin-menu']);

        $role = Role::create([
            'name'=>'Administrador'
        ]);

        $role->givePermissionTo(['admin-usuarios','admin-menu']);
    }
}
