<?php

namespace Database\Seeders;

use Faker\Factory as Faker;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

use App\Models\ScheduleStudentRel;
use App\Models\User;
use App\Models\Role;
use App\Models\Schedule;
use App\Models\Teacher;
use App\Models\Notice;

class NoticeTeacherRelSeeder extends Seeder
{
  /**
   * Run the database seeds.
   */

  public function run(): void
  {
    $teacher_1 = Teacher::find(1);
    $teacher_2 = Teacher::find(2);
    $teacher_3 = Teacher::find(3);

    $notice_1 = Notice::find(1);
    $notice_2 = Notice::find(2);
    $notice_3 = Notice::find(3);

    // NOTE: notice with teacher, default unread
    $teacher_1->notices()->attach($notice_3);

    // NOTE: teacher 1 with notice 2 read
    $teacher_1->notices()->attach($notice_2, ['status' => 'read']);

    // NOTE: notice_3 with teacher_2, default unread
    $teacher_2->notices()->attach($notice_3);
  }
}
