<?php

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

/**
 * Soft-suspension column. `disabled_at` is set by the admin to lock a user
 * out of the app without deleting their data; `LoginController::store`
 * refuses authentication when this is non-null. Distinct from
 * `email_verified_at` (which is a registration-flow signal, not a
 * disciplinary one) and from a hard delete (data preserved).
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->timestamp('disabled_at')->nullable()->after('remember_token');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('disabled_at');
        });
    }
};
