<?php

namespace Database\Seeders;

use App\Models\PayrollPeriod;
use Illuminate\Database\Seeder;

class PayrollPeriodSeeder extends Seeder
{
    public function run(): void
    {
        $now = now();

        foreach ([0, -1] as $monthOffset) {
            $date = $now->copy()->addMonths($monthOffset);

            PayrollPeriod::factory()->create([
                'year' => $date->year,
                'month' => $date->month,
            ]);
        }
    }
}
