<?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\Admin;
use App\Models\Notice;

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

  public function run(): void
  {
    $admin_1 = Admin::find(1);
    $admin_2 = Admin::find(2);
    $admin_3 = Admin::find(3);

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

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

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

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