truncate(); Post::truncate(); // Re-enable foreign key checks DB::statement('SET FOREIGN_KEY_CHECKS=1;'); // Get categories $categoryNews = Category::where('slug', 'news')->first(); $categoryEvent = Category::where('slug', 'event')->first(); $categoryLanding = Category::where('slug', 'landing-event')->first(); // News Posts (新聞) - 3 posts $newsPosts = [ [ 'title' => 'AI Academy Partners with Leading Tech Companies', 'slug' => 'ai-academy-tech-partnerships-2025', 'content' => '
We are excited to announce new strategic partnerships with leading technology companies to advance AI education and research.
These partnerships will bring cutting-edge resources and expertise to our community, enabling students to work on real-world AI projects and gain valuable industry experience.
', 'excerpt' => 'Strategic partnerships announced with major tech companies to enhance AI education.', 'status' => 'publish', 'post_type' => 'news', 'published_at' => now()->subDays(5), 'date' => now()->subDays(5)->format('Y-m-d'), 'image_url' => '2025/12/news-partnerships.png', 'featured_image' => true, ], [ 'title' => 'New AI Research Center Opens in Taipei', 'slug' => 'new-ai-research-center-taipei', 'content' => 'The AI Academy is proud to inaugurate a state-of-the-art research center in Taipei, equipped with the latest AI computing infrastructure.
The facility will serve as a hub for groundbreaking AI research and collaboration between academia and industry.
', 'excerpt' => 'State-of-the-art AI research center opens to advance innovation.', 'status' => 'publish', 'post_type' => 'news', 'published_at' => now()->subDays(15), 'date' => now()->subDays(15)->format('Y-m-d'), 'image_url' => '2025/12/research-center.png', 'featured_image' => true, ], [ 'title' => 'AI Academy Receives International Recognition', 'slug' => 'international-recognition-award', 'content' => 'The AI Academy has been recognized internationally for its outstanding contributions to AI education and research excellence.
This prestigious award highlights our commitment to advancing AI knowledge and fostering innovation.
', 'excerpt' => 'International award recognizes excellence in AI education.', 'status' => 'publish', 'post_type' => 'news', 'published_at' => now()->subDays(30), 'date' => now()->subDays(30)->format('Y-m-d'), 'image_url' => '2025/12/award-ceremony.png', 'featured_image' => true, ], ]; // Event Posts (活動) - 3 posts $eventPosts = [ [ 'title' => '2025 AI Summer Forum: AI × Southern Taiwan Innovation', 'slug' => 'ai-summer-forum-2025', 'content' => 'Join us for the 2025 AI Summer Forum, exploring how artificial intelligence is driving innovation across key industries in Southern Taiwan.
This full-day event features keynote speakers, panel discussions, and networking opportunities with industry leaders.
', 'excerpt' => 'Exploring AI innovation and its impact on key industries in Southern Taiwan.', 'status' => 'publish', 'post_type' => 'event', 'published_at' => now()->subDays(3), 'date' => now()->addDays(20)->format('Y-m-d'), 'time' => '0830-1630', 'image_url' => '2025/12/summer-forum.png', 'address' => 'National Cheng Kung University, Tainan', 'description' => 'As artificial intelligence technology rapidly evolves, this forum brings together experts to discuss practical AI applications in manufacturing, healthcare, and agriculture.
Participants will gain insights into the latest AI trends and connect with peers driving innovation in Southern Taiwan.
', 'link' => 'https://summer-forum.aiacademy.tw/', 'featured_image' => true, ], [ 'title' => 'AI Ethics and Governance Workshop', 'slug' => 'ai-ethics-governance-workshop', 'content' => 'A comprehensive workshop on AI ethics, responsible AI development, and governance frameworks.
Learn from leading experts about ethical considerations in AI deployment and best practices for responsible innovation.
', 'excerpt' => 'Workshop on ethical AI development and governance.', 'status' => 'publish', 'post_type' => 'event', 'published_at' => now()->subDays(10), 'date' => now()->addDays(30)->format('Y-m-d'), 'time' => '1400-1700', 'image_url' => '2025/12/ethics-workshop.png', 'address' => 'AI Academy Taipei Campus', 'description' => 'This workshop covers key topics including fairness in AI systems, privacy protection, transparency, and accountability.
Perfect for AI practitioners, policymakers, and anyone interested in responsible AI development.
', 'link' => 'https://ethics-workshop.aiacademy.tw/', 'featured_image' => true, ], [ 'title' => 'Deep Learning Bootcamp 2025', 'slug' => 'deep-learning-bootcamp-2025', 'content' => 'An intensive 5-day bootcamp covering advanced deep learning techniques and practical applications.
Hands-on training with industry experts using real-world datasets and projects.
', 'excerpt' => 'Intensive bootcamp on advanced deep learning techniques.', 'status' => 'publish', 'post_type' => 'event', 'published_at' => now()->subDays(20), 'date' => now()->addDays(45)->format('Y-m-d'), 'time' => '0900-1800', 'image_url' => '2025/12/bootcamp.png', 'address' => 'AI Academy Training Center, Kaohsiung', 'description' => 'Learn computer vision, natural language processing, and reinforcement learning from scratch to deployment.
Limited seats available. Early bird discount ends soon!
', 'link' => 'https://bootcamp.aiacademy.tw/', 'featured_image' => true, ], ]; // Insert news posts and attach categories foreach ($newsPosts as $postData) { $post = Post::create($postData); if ($categoryNews) { $post->categories()->attach($categoryNews->id); } } // Insert event posts and attach categories foreach ($eventPosts as $index => $postData) { $post = Post::create($postData); if ($categoryEvent) { $post->categories()->attach($categoryEvent->id); } // 第一個活動同時加入 landing-event 分類 if ($index === 0 && $categoryLanding) { $post->categories()->attach($categoryLanding->id); } } $this->command->info('Successfully seeded ' . count($newsPosts) . ' news posts and ' . count($eventPosts) . ' event posts.'); } }