<?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::table('gatepasses', function (Blueprint $table) {
            // Add vehicle and driver fields
            $table->string('vehicle_no')->nullable()->after('type');
            $table->string('driver_name')->nullable()->after('vehicle_no');
            $table->text('other_persons')->nullable()->after('driver_name');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('gatepasses', function (Blueprint $table) {
            // Remove the new fields
            $table->dropColumn(['vehicle_no', 'driver_name', 'other_persons']);
        });
    }
};
