<?php

namespace Database\Seeders;

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

class ServiceSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $clinic = \App\Models\Clinic::first();
        $doctors = \App\Models\Doctor::all();

        $service1 = \App\Models\Service::create([
            'name' => 'ENT Consultation',
            'duration' => 10,
            'price' => 400,
            'clinic_id' => $clinic->id
        ]);

        $service2 = \App\Models\Service::create([
            'name' => 'General Checkup',
            'duration' => 15,
            'price' => 300,
            'clinic_id' => $clinic->id
        ]);

        // Attach services to doctors
        $doctors[0]->services()->attach($service1->id);
        $doctors[1]->services()->attach($service2->id);
    }
}
