id(); $table->unsignedBigInteger('news_category_id')->index(); $table->foreign('news_category_id')->references('id')->on('news_categories')->comment('文章類別'); $table->string('news_img_pc')->nullable()->comment('列表圖 PC'); $table->string('news_img_mobile')->nullable()->comment('列表圖 MOBILE'); $table->json('title')->comment("標題"); $table->json('description')->comment("短文"); $table->json('written_by')->comment("編輯人"); $table->date('post_date')->comment("文章發布日"); $table->string('meta_img')->nullable()->comment('seo image'); $table->json("meta_title")->nullable()->comment("seo title"); $table->json("meta_keyword")->nullable()->comment("seo keyword"); $table->json("meta_description")->nullable()->comment("seo description"); $table->boolean('on_top')->default(0)->comment("置頂"); $table->boolean('visible')->default(1)->comment("顯示/隱藏"); $table->unsignedInteger('order')->default(0)->comment("排序"); $table->timestamps(); $table->softDeletes(); }); Schema::enableForeignKeyConstraints(); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('news'); } };