<?php

namespace Database\Seeders;

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

class LanguagesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $languages = [
            [
                'name' => 'Română',
                'code' => 'ro',
                'flag' => '🇷🇴',
                'is_default' => true,
                'is_active' => true,
                'sort_order' => 1
            ],
            [
                'name' => 'English',
                'code' => 'en',
                'flag' => '🇬🇧',
                'is_default' => false,
                'is_active' => true,
                'sort_order' => 2
            ]
        ];

        foreach ($languages as $language) {
            Language::updateOrCreate(
                ['code' => $language['code']],
                $language
            );
        }

        $this->command->info('Languages seeded successfully!');
    }
}
