<?php

namespace Database\Seeders;

use App\Element\CreateElementDto;
use App\Element\ElementRepository;
use App\Set\SetRepository;
use Illuminate\Database\Seeder;

class ElementSeeder extends Seeder
{
    public function run(): void
    {
        $setRepository = app(SetRepository::class);
        $elementRepository = app(ElementRepository::class);
        $baderechSet = $setRepository->find(1);
        $elementRepository->create(new CreateElementDto(
            set: $baderechSet,
            title: $baderechSet->getName(),
            parentElement: null,
        ));
    }
}
