'帮助', 'is_show' => 1], ['name' => '协议', 'is_show' => 1], ['name' => '文章', 'is_show' => 1, 'children' => [ ['name' => '自然', 'is_show' => 1], ['name' => '文化', 'is_show' => 1], ['name' => '生活', 'is_show' => 1], ]], ]; foreach($categoris as $item) { $category = ArticleCategory::create($item); } $articles = [ ['category_id' => 2, 'title' => '关于我们', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1], ['category_id' => 2, 'title' => '服务协议', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1], ['category_id' => 2, 'title' => '隐私协议', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1], ['category_id' => 2, 'title' => '佣金说明', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1], ]; foreach($articles as $item) { $article = Article::create($item); } } }