'Test Blog Post ' . $i, 'content' => $article . $article . $article, 'location' => null, 'created_at' => Carbon::today()->subDays(rand(1, 100)) ])->create()->tags()->saveMany(Tag::inRandomOrder()->limit(random_int(1, 3))->get()); } Post::factory([ 'title' => 'Test Blog Post 1', 'content' => $article, 'location' => null, 'created_at' => Carbon::today()->subDays(rand(1, 100)) ])->create()->tags()->saveMany(Tag::inRandomOrder()->limit(random_int(1, 3))->get()); Post::factory([ 'title' => 'Blog Post Test 2', 'content' => $article, 'location' => null, 'created_at' => Carbon::today()->subDays(rand(1, 100)) ])->create()->tags()->saveMany(Tag::inRandomOrder()->limit(random_int(1, 3))->get()); } }