create([ 'name' => 'Test User', 'email' => 'test@example.com', ]); $tags = Tag::factory(8)->create(); $topLevel = Category::factory(3)->create(); $topLevel->each(function (Category $category) { Category::factory(2)->childOf($category)->create(); }); $allCategories = Category::all(); Post::factory(20) ->recycle($author) ->state(fn () => ['category_id' => $allCategories->random()->id]) ->create() ->each(fn (Post $post) => $post->tags()->attach($tags->random(rand(1, 3))->pluck('id'))); Post::factory(3) ->draft() ->recycle($author) ->state(fn () => ['category_id' => $allCategories->random()->id]) ->create(); Tool::factory(4)->featured()->recycle($author)->create(); Tool::factory(20)->recycle($author)->create(); Tool::factory(3)->pending()->recycle($author)->create(); Page::factory()->create([ 'title' => 'About', 'slug' => 'about', 'body' => "We're a small team writing about AI tools, workflows, and everything in between.", 'order' => 1, ]); Page::factory()->create([ 'title' => 'Contact', 'slug' => 'contact', 'body' => 'Questions or feedback? Reach us at [hello@example.com](mailto:hello@example.com).', 'order' => 2, ]); Page::factory()->create([ 'title' => 'Privacy Policy', 'slug' => 'privacy-policy', 'body' => 'We respect your privacy and only collect the minimum data needed to run this site.', 'order' => 3, ]); } }