id(); $table->foreignId('user_id')->constrained()->onDelete('cascade'); $table->string('title'); $table->text('description')->nullable(); $table->enum('template', ['professional', 'modern', 'executive', 'minimal', 'technical'])->default('professional'); $table->json('content')->nullable(); // Resume content as JSON $table->json('settings')->nullable(); // Template settings as JSON $table->enum('status', ['draft', 'published', 'archived'])->default('draft'); $table->boolean('is_public')->default(false); $table->string('public_url')->nullable()->unique(); $table->timestamp('published_at')->nullable(); $table->integer('view_count')->default(0); $table->integer('download_count')->default(0); $table->timestamp('last_viewed_at')->nullable(); $table->timestamp('last_downloaded_at')->nullable(); $table->integer('completion_percentage')->default(0); $table->json('completion_sections')->nullable(); // Which sections are complete $table->string('pdf_path')->nullable(); // Path to generated PDF $table->timestamp('pdf_generated_at')->nullable(); $table->integer('pdf_version')->default(1); $table->json('analytics')->nullable(); // Analytics data $table->json('feedback')->nullable(); // User feedback/notes $table->boolean('allow_comments')->default(false); $table->string('password')->nullable(); // Password protection $table->timestamp('expires_at')->nullable(); // Public link expiration $table->json('share_settings')->nullable(); // Sharing permissions $table->string('slug')->nullable(); // SEO-friendly URL $table->json('seo_meta')->nullable(); // SEO metadata $table->timestamps(); $table->softDeletes(); // Soft delete for data recovery // Indexes for performance $table->index(['user_id', 'status']); $table->index(['is_public', 'published_at']); $table->index(['template']); $table->index(['created_at']); $table->index(['view_count']); $table->index(['slug']); $table->index(['public_url']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('resumes'); } };