id(); $table->foreignId('community_id')->constrained()->onDelete('cascade'); $table->foreignId('user_id')->constrained()->onDelete('cascade'); $table->string('title'); $table->text('content')->nullable(); $table->string('url')->nullable(); $table->enum('type', ['text', 'link', 'image'])->default('text'); $table->integer('votes')->default(0); $table->timestamps(); $table->index(['community_id', 'created_at']); $table->index(['user_id', 'created_at']); }); } public function down(): void { Schema::dropIfExists('posts'); } };