<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\ModuleAccess;

class ModuleAccessSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $modules = [ 'seller', 'rent', 'lease'];

        foreach ($modules as $module) {
            ModuleAccess::updateOrCreate(
                ['module_name' => $module],
                [
                    'is_visible' => true,
                    'roles' => json_encode(['admin']) // Only admin can view
                ]
            );
        }
    }
}
