<?php

namespace Database\Seeders;

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

class PermissionSeeder extends Seeder
{
    public function run()
    {

        $customerData=get_customer_permission();
        $roleName = 'main_customer';
        $role = Role::findOrCreate($roleName);
        foreach ($customerData as $d) {
            $permission = Permission::findOrCreate($d);
            $role->givePermissionTo($permission);
        }
    }
}
