id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->string('code')->unique(); $table->text('address'); $table->string('phone'); $table->enum('status', ['pending', 'paid', 'processing', 'shipped', 'completed', 'cancelled'])->default('pending'); $table->decimal('total', 12, 2); $table->timestamps(); $table->index(['user_id', 'created_at']); $table->index('status'); }); } public function down(): void { Schema::dropIfExists('transactions'); } };