<?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;
use App\Models\Teacher;
use App\Models\ExamResult;
use App\Models\Exam;

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

    $exam_1 = Exam::find(1);
    $exam_2 = Exam::find(2);

    $exam_result_1 = ExamResult::find(1);
    $exam_result_2 = ExamResult::find(2);
    $exam_result_3 = ExamResult::find(3);

    $teacher_3 = Teacher::find(3);

    // $exam_1->exam_results()->attach(
    //     $exam_result_2->id, [
    //         'student_id' => $student_1->id,
    //         'teacher_id' => $teacher_3->id,
    //     ]);

    // $exam_2->exam_results()->attach(
    //     $exam_result_3->id, [
    //         'student_id' => $student_2->id,
    //         'teacher_id' => $teacher_3->id,
    //     ]);

    // $student_result = Student::with(['exam_results'])
    //     ->get();
  }
}
