id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->foreignId('ticket_category_id')->nullable()->constrained()->nullOnDelete(); $table->foreignId('assigned_user_id')->nullable()->constrained('users')->nullOnDelete(); $table->string('title'); $table->text('content'); $table->string('status', 32)->default('open')->index(); $table->timestamp('last_replied_at')->nullable()->index(); $table->timestamp('closed_at')->nullable(); $table->timestamps(); $table->index(['user_id', 'status']); $table->index(['ticket_category_id', 'status']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('tickets'); } };