PHP Classes

File: database/migrations/2025_08_18_200152_add_two_factor_columns_to_users_table.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu   Jaxon DB Admin   database/migrations/2025_08_18_200152_add_two_factor_columns_to_users_table.php   Download  
File: database/migrations/2025_08_18_200152_add_two_factor_columns_to_users_table.php
Role: Class source
Content typex: text/plain
Description: Class source
Class: Jaxon DB Admin
Web application to manage SQL of databases
Author: By
Last change: Update of database/migrations/2025_08_18_200152_add_two_factor_columns_to_users_table.php
Date: 2 months ago
Size: 1,057 bytes
 

Contents

Class file image Download
<?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('users', function (Blueprint $table) {
           
$table->text('two_factor_secret')
                ->
after('password')
                ->
nullable();

           
$table->text('two_factor_recovery_codes')
                ->
after('two_factor_secret')
                ->
nullable();

           
$table->timestamp('two_factor_confirmed_at')
                ->
after('two_factor_recovery_codes')
                ->
nullable();
        });
    }

   
/**
     * Reverse the migrations.
     */
   
public function down(): void
   
{
       
Schema::table('users', function (Blueprint $table) {
           
$table->dropColumn([
               
'two_factor_secret',
               
'two_factor_recovery_codes',
               
'two_factor_confirmed_at',
            ]);
        });
    }
};