<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\Portal;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        $portalsData = [
            'lms' => ['url' => 'http://localhost:5174', 'icon' => 'BookOpen'],
            'cms' => ['url' => 'http://localhost:5175', 'icon' => 'UserCircle'],
            'content' => ['url' => 'http://localhost:5177', 'icon' => 'FileText'],
            'immigopro' => ['url' => 'http://localhost:5178', 'icon' => 'Building2'],
            'public_client' => ['url' => 'http://localhost:5179', 'icon' => 'Globe'],
            'payments' => ['url' => 'http://localhost:5176', 'icon' => 'DollarSign'],
            'user_portal' => ['url' => 'http://localhost:5180', 'icon' => 'User'],
        ];

        foreach ($portalsData as $key => $data) {
            Portal::where('key', $key)->update($data);
        }
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
    }
};
