<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Recommendation;
use App\Services\DummyDataService;

class RecommendationSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $recommendations = DummyDataService::getRekomendasiPembelajaran();

        foreach ($recommendations as $data) {
            Recommendation::updateOrCreate(
                ['id' => $data['id']],
                [
                    'judul' => $data['judul'],
                    'kategori' => $data['kategori'],
                    'youtube_link' => $data['youtube_link'],
                    'deskripsi' => $data['deskripsi'],
                ]
            );
        }
    }
}
