3, 'name' => '活動', 'slug' => 'event', ], [ 'id' => 4, 'name' => '新聞', 'slug' => 'news', ], [ 'id' => 7, 'name' => '登入頁面文章', 'slug' => 'landing-event', ], ]; // 插入分類資料(使用 DB::table 以保留特定 ID) foreach ($categories as $category) { DB::table('categories')->insert([ 'id' => $category['id'], 'name' => $category['name'], 'slug' => $category['slug'], 'created_at' => now(), 'updated_at' => now(), ]); } $this->command->info('Successfully seeded ' . count($categories) . ' categories.'); $this->command->info('Categories: 活動 (event), 新聞 (news), 登入頁面文章 (landing-event)'); } }