<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('leave_models', function (Blueprint $table) {
            $table->id();
            $table->string('user_name');
            $table->string('type');
            $table->string('category');
            $table->string('leave_from');
            $table->string('leave_to');
            $table->string('department');
            $table->unsignedBigInteger('acting_officer'); // Foreign key
            $table->foreign('acting_officer')->references('id')->on('users');
            $table->string('acting_status')->default('pending');
            $table->string('approve_officer');
            $table->string('approve_status')->default('pending');
            $table->string('reason');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('leave_models');
    }
};
