'Test Blog Post 1', 'content' => $article, 'location' => null ])->create()->tags()->saveMany(Tag::inRandomOrder()->limit(random_int(1, 3))->get()); BlogPost::factory([ 'title' => 'Blog Post Test 2', 'content' => $article, 'location' => null ])->create()->tags()->saveMany(Tag::inRandomOrder()->limit(random_int(1, 3))->get()); } }