<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class LanguageSeeder extends Seeder
{
    public function run(): void
    {
        $languages = config('languages.supported', []);

        foreach ($languages as $language) {
            DB::table('languages')->updateOrInsert(
                ['short_code' => $language['short_code']],
                array_merge($language, [
                    'created_at' => now(),
                    'updated_at' => now(),
                ])
            );
        }
    }
}
