id(); $table->string('title'); $table->string('slug')->unique(); $table->longText('content')->nullable(); $table->text('excerpt')->nullable(); $table->string('meta_title')->nullable(); $table->text('meta_description')->nullable(); $table->enum('status', ['draft', 'published', 'archived'])->default('draft'); $table->string('featured_image')->nullable(); $table->timestamp('published_at')->nullable(); $table->foreignId('author_id')->constrained('users')->onDelete('cascade'); $table->foreignId('parent_id')->nullable()->constrained('pages')->onDelete('cascade'); $table->integer('sort_order')->default(0); $table->string('template')->default('default'); $table->boolean('is_homepage')->default(false); $table->boolean('show_in_menu')->default(true); $table->timestamps(); $table->softDeletes(); $table->index(['status', 'published_at']); $table->index(['parent_id', 'sort_order']); $table->index('slug'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('pages'); } };