<?php

namespace Database\Seeders;

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

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

class ScheduleStudentRelSeeder extends Seeder
{
  /**
   * Run the database seeds.
   */
  public function run(): void
  {
    $student_1 = Student::find(1);
    $student_2 = Student::find(2);
    $student_3 = Student::find(3);

    $schedule_1 = Schedule::find(1);
    $schedule_2 = Schedule::find(2);
    $schedule_3 = Schedule::find(3);

    $schedule_1->students()->attach($student_1);

    $schedule_2->students()->attach($student_1);
    $student_2->schedules()->attach($schedule_2);

    $schedule_3->students()->attach($student_1);
    $student_2->schedules()->attach($schedule_3);
    $schedule_3->students()->attach($student_3);
  }
}
