unsignedBigInteger('created_by_id')->nullable(); $table->string('created_by_type')->nullable(); // Add an index for better query performance $table->index(['created_by_id', 'created_by_type']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('patient_notes', function (Blueprint $table) { // Remove the new columns $table->dropColumn('created_by_id'); $table->dropColumn('created_by_type'); }); } };