CourseSectionsTableSeeder.php 449 B

123456789101112131415161718192021
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. use App\Models\CourseSection;
  4. class CourseSectionsTableSeeder extends Seeder
  5. {
  6. public function run()
  7. {
  8. $course_sections = factory(CourseSection::class)
  9. ->times(50)
  10. ->make()
  11. ->each(function ($course_section, $index) {
  12. $course_section->course_book_id = 1;
  13. });
  14. CourseSection::insert($course_sections->toArray());
  15. }
  16. }