id(); $table->unsignedBigInteger('template_id')->nullable(); $table->string('subject'); $table->longText('content'); $table->timestamp('scheduled_at'); $table->enum('status', ['scheduled', 'sending', 'sent', 'failed'])->default('scheduled'); $table->unsignedBigInteger('created_by'); $table->json('delivery_report')->nullable(); $table->timestamps(); $table->foreign('template_id')->references('id')->on('email_templates')->onDelete('set null'); $table->foreign('created_by')->references('id')->on('users'); }); } public function down() { Schema::dropIfExists('email_scheduled'); } };