id(); // 類型:決定出現在哪個頁面 $table->enum('type', ['partner', 'impact'])->comment('類型: partner=合作夥伴證言輪播, impact=Voice of Impact 列表'); // 內容(支援 HTML) $table->longText('content_html')->comment('內容 HTML'); $table->text('content_summary')->nullable()->comment('內容摘要(可選)'); // 作者資訊 $table->string('author_name', 255)->comment('作者姓名'); $table->string('author_title', 255)->nullable()->comment('作者職稱(可選)'); // 公司資訊(可選) $table->string('company_name', 255)->nullable()->comment('公司名稱(可選)'); $table->string('company_logo_path', 500)->nullable()->comment('公司 logo 相對路徑(不含 uploads/)'); // 視覺圖片(共用單一欄位) // partner: carousel 左側大圖 // impact: Voice of Impact 作者照片(或該筆 Voice 的主視覺) $table->string('image_path', 500)->nullable()->comment('圖片相對路徑(不含 uploads/)'); // 顯示控制 $table->integer('sort')->default(999)->comment('排序(數字越小越前面)'); $table->enum('status', ['draft', 'publish'])->default('draft')->comment('發布狀態'); $table->boolean('featured')->default(false)->comment('是否精選(可選/保留欄位)'); $table->dateTime('published_at')->nullable()->comment('發布時間(可選,支援排程)'); $table->timestamps(); // 索引 $table->index('type', 'idx_type'); $table->index('status', 'idx_status'); $table->index('sort', 'idx_sort'); $table->index('published_at', 'idx_published_at'); $table->index('featured', 'idx_featured'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('voices'); } };