Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\LessonSection;
|
||||
use App\Models\Module;
|
||||
|
||||
class LessonSectionSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$pure = Module::where('name', 'Pure Mathematics')->first();
|
||||
|
||||
$sections = [
|
||||
['module_id' => $pure->id, 'title' => 'Year 1', 'order' => 1],
|
||||
['module_id' => $pure->id, 'title' => 'Year 2', 'order' => 2],
|
||||
];
|
||||
|
||||
foreach ($sections as $section) {
|
||||
LessonSection::updateOrCreate(
|
||||
['module_id' => $section['module_id'], 'title' => $section['title']],
|
||||
$section
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user