Rabbi_Gerzi/backend/database/seeders/ElementSeeder.php

175 lines
8 KiB
PHP

<?php
namespace Database\Seeders;
use App\Element\CreateElementDto;
use App\Element\ElementRepository;
use App\Set\SetRepository;
use Illuminate\Database\Seeder;
use RuntimeException;
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(),
iconImageUrl: '/assets/baderech-haavodah-icon.png',
richText: '',
pdfPath: null,
youtubeUrl: null,
parentElement: null,
));
$baderechChildElements = [
[
'title' => '1. Introduction',
'description' => 'Your beliefs influence your thinking, '
. 'and your thinking drives your choices. When you '
. 'nurture healthy beliefs - about yourself, about '
. 'the Creator, and about the meaning of life - you '
. 'unlock the ability to live with strength, confidence, '
. 'and hope.',
'richText' => $this->introductionRichText(),
'pdfPath' => '/assets/pdfs/baderech.pdf',
],
[
'title' => '2. Foundations',
'description' => 'Focal points for thriving in a chaotic '
. 'world. In this fast, complex era, you flourish when '
. 'you develop clarity, well-being, resilience, and the '
. 'ability to uplift the physical world with spiritual '
. 'intention.',
'richText' => '',
'pdfPath' => null,
],
[
'title' => '3. Divine Plan',
'description' => 'Understanding the unique greatness of our '
. 'generation and the call to remain hopeful, '
. 'optimistic, and resilient.',
'richText' => '',
'pdfPath' => null,
],
[
'title' => '4. Architecture of the Soul',
'description' => "Becoming a Baal Da'at - A Master of "
. 'Inner Awareness',
'richText' => '',
'pdfPath' => null,
],
[
'title' => '5. Arba Yesodot',
'description' => 'A structured approach to balanced living: '
. 'Physical & Financial Health, Relationships, Wisdom '
. 'and Guidance.',
'richText' => '',
'pdfPath' => null,
],
[
'title' => '6. Fluid Integration',
'description' => 'A series of practical exercises to '
. 'engender a shift in mindset, embed healthy routines, '
. 'positive life practices.',
'richText' => '',
'pdfPath' => null,
],
];
$introductionElement = null;
foreach ($baderechChildElements as $baderechChildElement) {
$createdElement = $elementRepository->create(new CreateElementDto(
set: $baderechSet,
title: $baderechChildElement['title'],
description: $baderechChildElement['description'],
iconImageUrl: null,
richText: $baderechChildElement['richText'],
pdfPath: $baderechChildElement['pdfPath'],
youtubeUrl: null,
parentElement: $rootElement,
));
if ($baderechChildElement['title'] === '1. Introduction') {
$introductionElement = $createdElement;
}
}
if ($introductionElement === null) {
throw new RuntimeException('Introduction element was not seeded');
}
$elementRepository->create(new CreateElementDto(
set: $baderechSet,
title: 'Fundamentals # 1: Living Our Way to a Wholesome '
. 'Fulfilled Life (Audio)',
description: '',
iconImageUrl: null,
richText: '',
pdfPath: null,
youtubeUrl: 'https://www.youtube.com/watch?v='
. 'yHx-r4p6hHU&t=1s',
parentElement: $introductionElement,
));
}
private function introductionRichText(): string
{
return '<h2 style="text-align: center;">'
. 'What is Baderech HaAvoda?</h2>'
. '<h3>Why We Need a Path of Spiritual Practice</h3>'
. "<p>A 'Baderech HaAvoda' is a way of living - a structured "
. 'path for inner and outer growth, spiritual refinement, and '
. 'personal development. It is the art and discipline of knowing '
. 'where to place your attention, how to engage your inner and '
. 'outer world, and how to live the kind of life Hashem designed '
. 'for human beings: a life of wholeness, integration, clarity, '
. 'and joy.</p>'
. '<p>Throughout Jewish history, our sages taught that no person '
. 'can reach their potential without a derech - a framework that '
. 'provides:</p>'
. '<ul><li>Direction</li><li>Focus</li><li>Discernment</li>'
. '<li>Continuity</li><li>Practical Steps</li></ul>'
. '<p>Baderech HaAvoda answers core human questions:</p>'
. '<ul><li>How do I grow?</li><li>How do I align my inner world '
. 'with my values?</li><li>How do I relate to challenges?</li>'
. '<li>Where should I place my mind, heart, and actions each '
. 'day?</li><li>How do I live as the person Hashem intended me '
. 'to be?</li></ul>'
. '<p>Without a derech, people react to life instead of '
. 'responding with wisdom.</p>'
. '<p>Without a derech, inspiration fades as quickly as it '
. 'comes.</p>'
. '<p>Without a derech, a person cannot integrate what they '
. 'learn into who they become.</p>'
. '<p>A Baderech HaAvoda is therefore not a luxury - it is a '
. 'necessity for anyone who wants to live consciously, '
. 'purposefully, and in alignment with their Creator.</p>'
. '<h3>The Challenge of Our Generation</h3>'
. '<p>We live in a time overflowing with information and '
. 'stimulation, yet starving for depth.</p>'
. '<p>Our generation faces challenges that previous generations '
. 'rarely confronted:</p>'
. '<ul><li>Constant Distraction</li><li>Fragmented Attention</li>'
. '<li>Emotional Overwhelm</li><li>Lack of clarity about '
. 'identity and purpose</li><li>Minimal guidance in inner '
. 'development</li><li>Being told what to think rather than how '
. 'to think</li><li>So many are Hashkafikly homeless</li></ul>'
. '<p>People today are not taught:</p>'
. '<ul><li>How to understand themselves</li><li>How to regulate '
. 'their minds</li><li>How to cultivate awareness</li><li>How to '
. 'build a healthy inner life</li><li>How to live as integrated '
. 'human beings</li><li>The few important areas in life to focus '
. 'on</li></ul>'
. '<p>We have incredible access to knowledge, yet many feel lost '
. '- not for lack of information, but for lack of direction.</p>'
. '<p>A Baderech HaAvoda gives structure to the soul, it creates '
. 'inner order, and it transforms scattered potential into '
. 'living wisdom. It is a map for living a wholesome, healthy, '
. 'and spiritually aligned life - the life we were created for.'
. '</p>';
}
}