<?php

use App\Models\Translation;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    public function up(): void
    {
        $keys = [
            'events.edit' => ['de' => 'Termin bearbeiten', 'en' => 'Edit event'],
            'events.new'  => ['de' => 'Neuer Termin',      'en' => 'New event'],
        ];

        foreach ($keys as $key => $locales) {
            foreach ($locales as $locale => $value) {
                Translation::updateOrCreate(
                    ['key' => $key, 'locale' => $locale],
                    ['value' => $value]
                );
            }
        }
    }

    public function down(): void {}
};
