<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class VocabularySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $n5 = \App\Models\Level::where('code', 'N5')->first();

        $vocabularies = [
            [
                'word' => '私',
                'reading' => 'わたし',
                'meaning_en' => 'I, me',
                'level_id' => $n5?->id,
            ],
            [
                'word' => '家',
                'reading' => 'いえ',
                'meaning_en' => 'House, home',
                'level_id' => $n5?->id,
            ],
            [
                'word' => '食べる',
                'reading' => 'たべる',
                'meaning_en' => 'To eat',
                'level_id' => $n5?->id,
            ],
            [
                'word' => '日本語',
                'reading' => 'にほんご',
                'meaning_en' => 'Japanese language',
                'level_id' => $n5?->id,
            ],
            [
                'word' => '勉強',
                'reading' => 'べんきょう',
                'meaning_en' => 'Study',
                'level_id' => $n5?->id,
            ],
        ];

        foreach ($vocabularies as $vocab) {
            \App\Models\Vocabulary::create($vocab);
        }
    }
}
