id(); $table->string('username')->unique(); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->enum('type', ['admin', 'user', 'moderator'])->default('user'); $table->rememberToken(); $table->timestamps(); }); Schema::create('tokens', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('user_id'); $table->string('token'); $table->enum('type', ['email_verification', 'password_reset']); $table->timestamp('created_at')->useCurrent(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); }); Schema::create('sessions', function (Blueprint $table) { $table->string('id')->primary(); $table->foreignId('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->longText('payload'); $table->integer('last_activity')->index(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('users'); Schema::dropIfExists('password_reset_tokens'); Schema::dropIfExists('sessions'); } };