初始化
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\ForumBoard;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ForumBoardSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$boards = [
|
||||
[
|
||||
'name' => '选型咨询',
|
||||
'slug' => 'selection',
|
||||
'description' => '多口 TypeC 接口IC 选型、参数对比与技术方案讨论。',
|
||||
'sort' => 1,
|
||||
],
|
||||
[
|
||||
'name' => '调试与量产',
|
||||
'slug' => 'debug',
|
||||
'description' => 'PCB 布局、EMI 整改、量产测试经验分享。',
|
||||
'sort' => 2,
|
||||
],
|
||||
[
|
||||
'name' => '行业资讯',
|
||||
'slug' => 'news',
|
||||
'description' => 'TypeC 快速充电行业动态、标准更新与市场趋势。',
|
||||
'sort' => 3,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($boards as $board) {
|
||||
ForumBoard::firstOrCreate(['slug' => $board['slug']], $board);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user