<?php

namespace Database\Seeders;

use App\Enums\PlatformEnum;
use App\Models\PlatformInstance;
use Illuminate\Database\Seeder;

class PlatformInstanceSeeder extends Seeder
{
    public function run(): void
    {
        collect([
            [
                'platform' => PlatformEnum::LEMMY,
                'url' => 'belgae.social',
                'name' => 'Belgae Social',
                'description' => 'A Belgian Lemmy instance on the fediverse',
            ],
        ])->each(fn ($instanceData) => PlatformInstance::updateOrCreate(
            [
                'platform' => $instanceData['platform'],
                'url' => $instanceData['url'],
            ],
            $instanceData
        )
        );
    }
}
