diff --git a/database/migrations/2024_08_27_071158_update_users_table.php b/database/migrations/2024_08_27_071158_update_users_table.php index 8ae0073..4d4e0f8 100644 --- a/database/migrations/2024_08_27_071158_update_users_table.php +++ b/database/migrations/2024_08_27_071158_update_users_table.php @@ -1,32 +1,33 @@ string('nik')->nullable()->after('email'); - $table->foreignIdFor(Branch::class)->nullable()->after('nik')->constrained('branches'); - }); - } + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::table('users', function (Blueprint $table) { + $table->string('nik')->nullable()->after('email'); + $table->foreignIdFor(Branch::class)->nullable()->after('nik')->constrained('branches'); + }); + } - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->dropColumn('nik'); - $table->dropForeign(['branch_id']); - $table->dropColumn('branch_id'); - }); - } -}; + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('nik'); + $table->dropForeign(['branch_id']); + $table->dropColumn('branch_id'); + }); + } + };