<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\ScheduleSubjectRel;
use Faker\Factory as Faker;

use App\Models\User;
use App\Models\Role;
use App\Models\Schedule;
use App\Models\Subject;

class ScheduleSubjectRelSeeder extends Seeder
{
  /**
   * Run the database seeds.
   */
  public function run(): void
  {
    $schedule = Schedule::find(1);
    $subject = Subject::find(1);
    $schedule->subjects()->attach($subject->id);

    foreach (range(2, 20) as $index) {
      $schedule = Schedule::find($index);
      $subject = Subject::find($index);
      $schedule->subjects()->attach($subject->id);
    }
  }
}
