Rabbi_Gerzi/backend/database/seeders/ElementSeeder.php

47 lines
1.7 KiB
PHP

<?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);
$rootElement = $elementRepository->create(new CreateElementDto(
set: $baderechSet,
title: $baderechSet->getName(),
description: $baderechSet->getDescription(),
richText: '<p>Begin with a clear map for avodah growth.</p>'
. '<p><strong>Move steadily</strong> from awareness '
. 'to practice.</p>',
pdfPath: '/assets/pdfs/baderech.pdf',
parentElement: null,
));
$elementRepository->create(new CreateElementDto(
set: $baderechSet,
title: 'Avodah Foundations',
description: 'Core foundations for building a steady '
. 'avodah practice.',
richText: '<p>Avodah foundations begin with honest awareness '
. 'and small repeatable steps.</p>',
pdfPath: null,
parentElement: $rootElement,
));
$elementRepository->create(new CreateElementDto(
set: $baderechSet,
title: 'Daily Practice',
description: 'Practical steps for consistent daily growth.',
richText: '<p>Daily practice turns inspiration into a '
. 'dependable rhythm.</p>',
pdfPath: null,
parentElement: $rootElement,
));
}
}